Python Does Not Find Packages Installed Without Anaconda

Python Does Not Find Packages Installed Without Anaconda

I'm trying to install kivy for python 3 using apt-get:

    sudo apt-get install python3-kivy

And it is installed in

    /usr/lib/python3/dist-packages

But, when I tried to load it in python, I get a ModuleNotFoundError

    Python 3.6.3 |Anaconda custom (64-bit)| (default, Oct 13 2017, 12:02:49) 
    [GCC 7.2.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import kivy
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ModuleNotFoundError: No module named 'kivy'

When I check the system path from python, I only get packages in Anaconda:

    >>> import sys
    >>> print('\n'.join(sys.path))

    /home/santiago/anaconda3/lib/python36.zip
    /home/santiago/anaconda3/lib/python3.6
    /home/santiago/anaconda3/lib/python3.6/lib-dynload
    /home/santiago/anaconda3/lib/python3.6/site-packages
    /home/santiago/anaconda3/lib/python3.6/site-packages/torchvision-0.2.0-py3.6.egg

Is there any way to include the '/usr/lib/python3' path to Anaconda?

Thanks.

1

1 Answer

Anaconda isolate your python environment from the rest of the system. Thus, you only can use python packages installed with conda or anaconda pip version.

conda install -c conda-forge kivy

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Marcus Vance
Author

Marcus Vance

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.