Package installed by Conda, Python cannot find it

I am trying to install Theano Anaconda. It works, but when I enter python -i, it import theanoshows No module named 'theano'. Do I need to switch another Python interpreter like? Also, for packages installed by conda, if I do not install them twice, can I find in Python? How is Python related to Anaconda Python? Thank!!!

+8
source share
2 answers

You can access a specific version of python using the following line in the first line of your .py file. This is for python 2.7

#!/usr/bin/env python2.7

This is for python 3

#!/usr/bin/env python3

, , sys. :

import sys
print(sys.path)

sys.path :

sys.path.append('/path/to/the/folder/of/your/module/file')

PYTHONPATH.

: fooobar.com/questions/17622/...

0

, . :

conda install -c conda-forge folium :

./anaconda3/envs/[name env]/lib/python3.7/site-packages/folium

pip ( anaconda env), pip install folium, :

./anaconda3/lib/python3.7/site-packages/folium

Python - Python, . Python ( distutils, , python setup.py install), .

: /anaconda3/lib/python3.7/site-packages/ /anaconda3/envs/[name env]/lib/python3.7/site-packages/.

/anaconda3/lib/python3.7/site-packages/. ( , ) - conda env PATH.

, , 2 :

  • pip install folium import folium ( conda install),

  • conda conda init, . , .

pip conda.

0

Source: https://habr.com/ru/post/1656477/


All Articles