The Module Has Been Successfully Installed But Then It's Not Found When Imported? - Python
Solution 1:
Try using virtual environments.
$ virtualenv -p python3 `/path/to/venv/dir`$ . `/path/to/venv/dir/bin/activate`
(venv) $ # indicates virtual env is configured
(venv) $ which pip python3
(venv) $ pip install whatever
(venv) $ python3 script.py
Solution 2:
It is quite common to have such cases when there are multiple installations of python.
From the snapshot, we can infer that python 3.5 is default for the system and python 3.6 is installed for the specific user (Oliver Jr).
Installing any module without setting path variable will result in installing the module in default python (python 3.5)
Inorder to use the module in python 3.6, set the path variable as
SET PATH=C:\Users\Oliver Jr\Anaconda>;%PATH%;
Check if default python version is changed to python 3.6 by using
python --version
Then install the module using
pip install graphviz
You can also install using C:\UsersOliver Jr\Anaconda\bin\pip install graphviz
Solution 3:
Your system python is 3.5.2
While IPython appears to be using 3.6
based on the sys.path
output.
Try pip3.6 install graphviz
Solution 4:
Try to list out installed packages in your python:
$pip freeze
Usually it happened because of PYTHONPATH problem. Did you try to reinstall your iPython? Maybe it was installed using different version of python.
$pip uninstall ipython
$pip install ipython
I tried using Python 3.6.3, it works well. Or you can try;
$pip3.6 install graphviz
Solution 5:
You have 2 Python installations - one ordinary, as downloadable from https://www.python.org, installed in C:\Python
; and another one, the self-contained Anaconda installation C:\Users\Oliver Jr\Anaconda
.
You have installed Graphviz in the former - the standard Python distribution that resides in C:\Python
, but you've installed IPython in Anaconda!
Since I suspect that you'd much prefer Anaconda over the standard Python as it makes installing scientific and mathematical packages on Windows much easier, you'd probably want to install it in your Anaconda distribution:
conda install -c anaconda graphviz
Post a Comment for "The Module Has Been Successfully Installed But Then It's Not Found When Imported? - Python"