I have installed VTK on Canopy but when I try to run a VTK Python program, it throws me Error:
import vtkpython
ImportError: No module named 'vtkpython
Can Someone tell me Why I am getting this error.
To use VTK's python wrapper, import vtk, not "vtkpython".
Better yet, use tvtk or Mayavi's mlab interface rather than using the "raw" vtk library directly.
Otherwise, using VTK is going to feel very "unpythonic".
Related
I am getting these errors trying to run a python3 program in itelliJ IDEA on a mac.
import numpy as np
ModuleNotFoundError: No module named 'numpy'
from PIL import Image, ImageChops
ModuleNotFoundError: No module named 'PIL'
from skimage.feature import match_template # requires numpy, scipy, and six
ModuleNotFoundError: No module named 'skimage'
All of these modules have been successfully installed using pip3. I have confirmed the installs using IDLE. Clearly, it seems, there is more to it than simply installing, but I don't know what it is.
I cannot find anything that addresses concerns on python.org. They, in fact, refer me to Stackoverflow. The closest I found here dealt with numpy and python2.7 on mac. There are no responses to that one.
Look in the Preferences for the Project Interpreter setting, and make sure it's pointing to the right python version.
Secondly, since you're already using and IDE use PyCharm. It's IntelliJ's python specific IDE, and it'll have better documentation on python specific technical problems.
In Julia I am using the module PyCall
using PyCall: #pyimport
When I then try to use the scikitlearn library's module called ensamble, there is no problem, it works and I can use the module:
#pyimport sklearn.ensemble as skle
However when I try to do the same with the PIL library or PIL library's module Images, it doesn't work.
#pyimport PIL.Image as PILI
I get the following error: ERROR: PyError (:PyImport_ImportModule)
ImportError('No module named PIL.Image',)
[inlined code] from /home/lara/.julia/v0.4/PyCall/src/exception.jl:81
in pyimport at /home/lara/.julia/v0.4/PyCall/src/PyCall.jl:387
Can someone please talk me through the steps to get this working becasue I don't see how this is different from the scikit learn library and ensamble module.
Based on discussion in the comments, the issue appears to be that PyCall is using its own Python installation which does not have the requisite library installed. There are two options:
follow these instructions to change the Python installation referenced by PyCall to your local one in /home/lara/anaconda2.
use Conda.jl to add PIL to the Conda.jl Python install:
Conda.add("Pillow") (you could probably use PIL, but Pillow is a compatible fork that is actively maintained from what I can tell)
The second option is probably slightly preferred, but if you have many packages installed already it may be simpler to try the first option (you can always switch back to the Conda.jl version if something doesn't work).
I originally installed the anaconda distribution of python and have been coding primarily in Spyder. Recently I tried to install the Chaco visualization library and had a lot of trouble getting it to work using pip install - so instead I installed the Unthought Tool Suite which comes with Chaco. This means I now have two python distributions, but I'm not using virtualenv.
I get this error when running any code in Spyder using numpy:
ImportError:
dlopen(/Users/snoran/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-
packages/numpy/linalg/lapack_lite.so, 2): Library not loaded:
#rpath/lib/libmkl_intel_lp64.dylib Referenced from:
/Users/snoran/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-
packages/numpy/linalg/lapack_lite.so Reason: image not found
When importing bumpy throguh the IPython console, I get:
ImportError: cannot import name scimath
Does anyone have any suggestions on how to fix this?
I am using Mac OS X
I'm involved in a raspberry pi project and I use python language. I installed scipy, numpy, matplotlib and other libraries correctly. But when I type
from scipy.io import wavfile
it gives error as "ImportError: No module named scipy.io"
I tried to re-install them, but when i type the sudo cord, it says already the new version of scipy is installed. I'm stucked in this point and please help me... Thank you
I would take a guess and say your Python doesnt know where you isntalled scipy.io. add the scipy path to PYTHONPATH.
When I follow this link to install numpy my Autodesk maya 2012. I know maya 2012 has own python interpreter version 2.6.4 so that I installed numpy 1.7.1, Python 2.6 version.
import sys
sys.path.append("C:/Python26/Lib/site-package/numpy")
sys.path.append("C:/Python26/Lib/site-package/numpy/lib")
import numpy
# Error: ImportError: No module named numpy #
sys.path.append("C:/Python26/Lib/site-package")
import numpy
# Error: ImportError: No module named numpy #
After I follow this instruction, and execute commands at the python interpreter, It causes an error. However, It has already applied on the python 2.6 standalone. How to apply extensions on the maya interpreter?
You might find this link helpful: http://animateshmanimate.com/2011/03/30/python-numpy-and-maya-osx-and-windows/
It might also be possible to do it via easy_install although (like so much of maya python) there are some catches, as detailed in this question: How can I install Python modules programmatically / through a Python script?