Whenever I try to run a script the python interpreter always shows an ImportError
message such as (e.g.) No module named 'setuptools'
. So, I tried install (or to satisfy this requirement) with apt-get
... I do this for both Python 2.7 and Python 3.5 until Requirement already satisfied
.
First of all, I don't work with Python 2.7, but it's the defaul version for the interpreter. So, how could I solve this problem to work with Python 3.5? I tried this:
>>> import sys
>>> print(sys.path)
['',
'/usr/local/lib/python35.zip',
'/usr/local/lib/python3.5',
'/usr/local/lib/python3.5/plat-linux',
'/usr/local/lib/python3.5/lib-dynload',
'/usr/local/lib/python3.5/site-packages']
This was for Python3, for Python2 I did the same to compare the paths and I got this:
>>> import sys
>>> print(sys.path)
['',
'/usr/local/lib/python2.7/dist-packages/pygame-1.9.2b8-py2.7-linux-x86_64.egg',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-x86_64-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages/PILcompat',
'/usr/lib/python2.7/dist-packages/gtk-2.0']
Now... Should it work if I use the append()
method to add all the paths of Python2 to the paths in Python3? Also, I've been considered to completely uninstall Python2, but I know this will cause more problems in my system that the one I try to solve.