I wanted to installed logilab-common 0.61.0 on to my computer I am a windows user and my python version i 27. Whenever I import the module it throws me the error
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import logilab
File "logilab\__init__.py", line 28, in <module>
from logilab.common.__pkginfo__ import version as __version__
ImportError: No module named common.__pkginfo__
However I checked this file exists. Also when I try to call Pylint (the reason I installed logilab) from command line it throws import error
Loaded Module logilab not not found in sys.modules
I also tried to reinstall logilab and logilab astng. I do not If its a compatibility issue perhaps?
You probably have two distinct installation of the logilab package, one for logilab-common and the other for logilab-astng. Take a look at:
import logilab
print logilab.__path__
You should fix things (adjust PYTHONPATH?) so that you get the directory containing the common subdirectory there.
Also notice that for recent version of pylint (>= 1.0), logilab-astng has been replaced by astroid.
Related
I have python 3.10 installed on disk C: and Anaconda with Python 3.9 on disk D:. When I try importing numpy in jupyter, I get the following error.
>>> import numpy
Traceback (most recent call last):
File "C:\Python310\Lib\site-packages\numpy\core\__init__.py", line 23, in <module>
from . import multiarray
File "C:\Python310\Lib\site-packages\numpy\core\multiarray.py", line 10, in <module>
from . import overrides
File "C:\Python310\Lib\site-packages\numpy\core\overrides.py", line 6, in <module>
from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python310\Lib\site-packages\numpy\__init__.py", line 140, in <module>
from . import core
File "C:\Python310\Lib\site-packages\numpy\core\__init__.py", line 49, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.9 from "D:\ProgramData\Anaconda3\python.exe"
* The NumPy version is: "1.23.3"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: No module named 'numpy.core._multiarray_umath'
Looks like Python interpreter from disk D: is looking for libraries in disk C:, and I suppose that the numpy file installed there is not compatible with python 3.9. I think it's because my PYTHONPATH is
>>> print("PYTHONPATH:", os.environ.get('PYTHONPATH'))
PYTHONPATH: C:\Python310\Lib\site-packages
But how do I change it so that Jupyter only looks for what's in Anaconda folder libraries and not break whatever I have on disk C:? I guess what I'm asking is, is it possible to have 2 PYTHONPATHs, one for Jupyter and one for whatever else? Would it be sufficient to just add Anaconda libraries folder to PYTHONPATH, or it would cause conflicts? Because how would Jupyter choose one path over the other?
I installed ros1 and created a catkin workspace. Inside the src folder I cloned a ros package "executive_smach_visualization". But when I try to run it with the following command I am getting an error.
rosrun smach_viewer smach_viewer.py
Traceback:
wxversion 2.8 is not installed, installed versions are ['3.0-gtk3']
Traceback (most recent call last):
File "/home/developer/catkin_ws/src/executive_smach_visualization/smach_viewer/scripts/smach_viewer.py", line 77, in <module>
from smach_viewer import xdot
File "/home/developer/catkin_ws/src/executive_smach_visualization/smach_viewer/src/smach_viewer/xdot/__init__.py", line 1, in <module>
import wxxdot
File "/home/developer/catkin_ws/src/executive_smach_visualization/smach_viewer/src/smach_viewer/xdot/wxxdot.py", line 22, in <module>
from xdot import *
File "/home/developer/catkin_ws/src/executive_smach_visualization/smach_viewer/src/smach_viewer/xdot/xdot.py", line 34, in <module>
import gobject
ImportError: No module named gobject
I have already tried following:
1) Installed goobject using pip
2) cloned gobject from git to src folder of catkin_ws, catkin_make and setup.bash
What could be the problem? Please let me know if I am missing any important input. Thanks in advance.
This issue occurs if there is different version of ros, python and so on.
It seems package is a little bit outdated.
Edit:
After downloading package and when building your working environment, use:
catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python2 -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so
Please refer to 1.5 section (User configuration) of this guide
I'm having issues running ortools on Linux. I downloaded it from google's site (https://developers.google.com/optimization/) and installed it using "make install," but when I go to use it in python I get the following:
Traceback (most recent call last):
File "regular.py", line 42, in <module>
from ortools.constraint_solver import pywrapcp
File "/home/m3/summer/ortools_examples/examples/python/ortools.py", line 2, in <module>
ImportError: No module named linear_solver
It looks like despite installing ortools, its still not in my python path correctly, so when I call it in the file, it doesn't find anything and returns an error, right? Any advice on how to solve this?
I'm using Anaconda3 version 4.2.0 on ubuntu (in docker).
Anaconda is installed in /root/anaconda3 folder.
I installed theano_bpr package using pip install theano_bpr.
Now when i open python and try import theano_bpr, i get the following message:
>>> import theano_bpr
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/root/anaconda3/lib/python3.5/site-packages/theano_bpr/__init__.py", line 17, in <module>
from bpr import BPR
ImportError: No module named 'bpr'
However, when i navigate to /root/anaconda3/lib/python3.5/site-packages/theano_bpr/ and run python there, i'm able to import theano_bpr.
In /root/anaconda3/lib/python3.5/site-packages/theano_bpr/ there are following files:
__init__.py, bpr.py (this one is causing problems), t.py, and utils.py.
I tried installing Rtree 0.7.0 from PyPI, but I keep getting ImportError: No module named index when I try to use it. I downloaded and ran the Rtree-0.7.0.win32.exe from the Downloads page, and everything appears to be installed properly.
Here's the full error message that I get (from the Python 3.2.2 shell):
>>> from rtree import index
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
from rtree import index
File "C:\Python32\lib\site-packages\rtree\__init__.py", line 1, in <module>
from index import Rtree
ImportError: No module named index
>>> import rtree
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import rtree
File "C:\Python32\lib\site-packages\rtree\__init__.py", line 1, in <module>
from index import Rtree
ImportError: No module named index
The error message indicates that there's no module named 'index', but when I look in my C:\Python32\lib\site-packages\rtree\ directory, I see that it's there.
What could be causing me to still get the ImportError: No module named index error message, and how can I fix it so I can use the RTree module?
It appears to rely on import foo doing a relative import. It was the default behavior in 2.x (from 2.5 onwards there's a __future__ directive overriding that). Python 3 removed this. So the maintainers probably didn't even try to be 3.x-compatible, and the installation just worked by chance. Appropriately, there is no claim of Python 3 compatibility: No Programming Language :: Python :: 3 trove classifier, no mention in the documentation, no use of 2to3 in setup.py, etc. Short of patching rtree to fix this, and probably numerous other issues, you won't get it to work.