I have successfully installed the package scikit-image in my python project. However, I can't seem to import it to my python code. It seems it has a problem with the hyphen in the package. I have tried to install skimage, but it pip does not want to install this package and suggest I should install scikit-image instead. Does anyone know how I can solve this problem?
To install:
pip install scikit-image
To check which version is installed:
pip show scikit-image
To use in Python:
import skimage
or, something more specific:
from skimage.morphology import skeletonize
If that doesn't work, run each of the following commands and paste the output into your question:
which pip
pip -V
which python
python -V
Related
I'm trying to use torchaudio but I'm unable to import it. I have installed it and it is also visible through the pip list.
<ipython-input-6-4cf0a64f61c0> in <module>
----> 1 import torchaudio
ModuleNotFoundError: No module named 'torchaudio'
pytorch-lightning 1.2.0
torch 1.10.1
torchaudio 0.10.1
torchvision 0.11.2
WARNING: You are using pip version 21.1.2; however, version 21.3.1 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
Since you are using linux and CPU, you should consider uninstalling every pytorch related packages and re-install them via:
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
as shown here.
I was stuck with the same error. Tried a lot of ways to install and use torchaudio.
This was worked for me (after uninstalling existing torchaudio):
import os
!git clone https://github.com/pytorch/audio.git
os.chdir("audio")
!git checkout 632ea67
!python setup.py install
HI i'm trying to import pymc3 after pip installing it from the command line within the library where Python.exe sits in. (i.e. >>python -m pip install pymc3). after checking the Lib/Site-Packages library, there's no pymc3, but there is a theanos package installed though. i've looked everywhere for the pymc3 package but can't find it. i've tried installing pymc4 and same thing happens. any idea why?
You should be able to run pip straight for command line.
IE: the command is "pip install pymc3"
Then you would need to import it.
Your issue might also be that you recently installed python and have pip3 installed and not pip. You can check if pip vs pip3 is installed with pip --version and pip3 --version.
Whichever one of those responds with some form of pip XX.X.X from /.... would be the command you need to run.
If you do have pip3 then the command to run from the command line would be "pip3 install pymc3"
Are you able to do
import pymc3
in a Python script? If so, you can find out where it's installed with
print(pymc3.__file__)
Import error: C extension: NO MODULE NAMED TIMEDELTAS NOT BUILT. If you want to import PANDAS from the source directory, you may need to run 'python setup.py build_ext --inplace' to build the C extensions first.
I tried following things up to now but couldn't resolve this :
pip install --upgrade pip
pip install --upgrade pandas
uninstalled the existing version of pandas and installed again.
pip install Cython
Please look at the SCREENSHOT ATTACHED ABOVE SHOWS VERSION of PANDAS, NUMPY, PYTZ, SIX installed on my system.
NOTE : I'm using Python 2.7
Any help on this will be appreciated.
Thanks.
This question already has answers here:
Python basemap module impossible to import
(18 answers)
Closed 2 years ago.
What works is
import mpl_toolkits
What not works is (Import Error basemap not found)
from mpl_toolkits.basemap import Basemap
I followed the instructions here :
http://matplotlib.org/basemap/users/installing.html
Downloaded the lastest basemap*.tar.gz
I run the following commands:
Inside the geos folder
export GEOS_DIR=~/
./configure --prefix=$GEOS_DIR
make
make install
Inside the basemap folder
python setup.py install
Everything runs in sudo mode and no errors. Goes outputs no python binding but not as an error so i am not sure.
It seems not to be properly installed.
Mac Os X 10.10 Yosemite
Python 2.7.6
if i type
pip install basemap --allow-external basemap --allow-unverified basemap
Requirement already satisfied (use --upgrade to upgrade): basemap in /Library/Python/2.7/site-packages
so it is there but not importable?
What worked for me was this:
brew install gdal
For completeness, I did these things too:
conda install basemap
But this should be similar to your pip install method above.
Also, for completeness, I added this line to my .bash_profile:
export GEOS_DIR=/usr/local/Cellar/geos/3.4.2/
You may need to edit the version number.
Then, you can run:
from mpl_toolkits.basemap import Basemap
The easiest way to install basemap on OS X is to use Ports.
Just type in the below command and the see the magic unfold:
port install py-matplotlib-basemap
Correct me if I am wrong. Using MacPorts will install a "port" version of python.
If you started off with Anaconda python distribution, the easiest way is:
conda install -c anaconda basemap=1.0.7
Please see the page from Anaconda here
The better way is upgrade matplotlib module as follows:
pip3 install matplotlib --upgrade
I'm trying to install scipy, scikit-learn, and gensim on Windows 7 with Python 3.3.
If I try any of these:
pip install sci
pip install scipy
pip install scikit-learn
pip install gensim
I end up with an ImportError similar to:
ImportError: no module named numpy
And yes, I have installed numpy - it works fine if I try to import it in Python. I've managed to install scipy and scikit-learn by downloading executable installers, but gensim doesn't have one...
I've also tried using easy_install for all three, but that doesn't work either.
Is it something to do with the Python installation? Any ideas? Thanks a lot in advance!