ubuntu - How to set python installed path? -


my pyhton2.7 installed in /usr/local/lib. if type which python2.7, can have /usr/local/bin/python2.7. set pythonpath in ~/.bashrc as

export pythonpath="/usr/local/bin/python2.7:$pythonpath" 

i install pip , virtual environment. tried as

sudo apt-get install python-pip python-dev python-virtualenv 

i had error , still looking python in /usr/lib. error is

reading package lists... done building dependency tree        reading state information... done python-dev newest version. python-pip newest version. python-virtualenv newest version. 0 upgraded, 0 newly installed, 0 remove , 362 not upgraded. 1 not installed or removed. after operation, 0 b of additional disk space used. want continue? [y/n] y setting python2.7 (2.7.6-8ubuntu0.2) ... python2.7: can't open file '/usr/lib/python2.7/py_compile.py': [errno 2] no such file or directory dpkg: error processing package python2.7 (--configure):  subprocess installed post-installation script returned error exit status 2 errors encountered while processing:  python2.7 e: sub-process /usr/bin/dpkg returned error code (1) 

how can set python path properly?

edit: echo $path gave

/usr/local/bin:/usr/local/cuda-8.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/bin/python2.7 

echo $pythonpath gave

/home/coie/softwares/apollocaffe/python:/usr/local/bin/python2.7: 

according https://askubuntu.com/a/250935/610294:

try appending pythonpath instead of overwriting completely.

read: replace line added bashrc this:

export pythonpath=$pythonpath:/usr/local/bin/python2.7


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - IE9 error '$'is not defined -