I installed python3.5.2 from my home directory from a tar. (I remember using an atlinstall command)
Then, I installed django using pip3, by doing sudo -H pip3 install django
, and the installation was successful.
I also installed numpy, scipy, some other modules.
All these modules are accessible when I am using python3.5
as the command from the command line, but I am not able to import these modules when I call python3
.
And, all the third party software is also using this python3
, as a result I am not able to use any GUI to import any of the modules mentioned.
My question is, how I can get the other python3 to point to the same thing as python3.5
which has all the modules installed.
salman@Skynet ~]$ python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'django'
>>> exit()
[salman@Skynet ~]$ python3.5
Python 3.5.2 (default, Nov 30 2016, 11:30:08)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>>
It works when python3.5
is used.
Edit: Requested outputs
which python3 python3.5
:
/usr/bin/python3
/usr/local/bin/python3.5
env | grep -i python; for p in $(ls /usr{,/local}/bin/python3*); do echo -- $(ls -l $p); $p -c "import sys; print(sys.path)"; done
-- lrwxrwxrwx 1 root root 9 Mar 23 2016 /usr/bin/python3 -> python3.5
['', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib- dynload', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages']
-- -rwxr-xr-x 2 root root 4460336 Nov 18 01:23 /usr/bin/python3.5
['', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib- dynload', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages']
-- -rwxr-xr-x 2 root root 4460336 Nov 18 01:23 /usr/bin/python3.5m
['', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib- dynload', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages']
-- lrwxrwxrwx 1 root root 10 Mar 23 2016 /usr/bin/python3m -> python3.5m
['', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib- dynload', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages']
-- -rwxr-xr-x 2 root root 12170760 Nov 30 11:30 /usr/local/bin/python3.5
['', '/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']
-- -rwxr-xr-x 2 root root 12170760 Nov 30 11:30 /usr/local/bin/python3.5m
['', '/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']
-- -rwxr-xr-x 1 root root 3080 Nov 30 11:31 /usr/local/bin/python3.5m-config
Usage: /usr/local/bin/python3.5m-config --prefix|--exec-prefix|-- includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|-- configdir
Also, how can I delete the python3.5 from the /usr/local/bin
without harming the python3 in /usr/bin
?
Thank you everyone for reading the question and answering.
which python3
andwhich python3.5
? – michael Nov 30 '16 at 09:25which python3 -> /usr/bin/python3
,which python3.5 -> /usr/local/bin/python3.5
– Skynet094 Nov 30 '16 at 09:29env | grep -i python; for p in $(ls /usr{,/local}/bin/python3*); do echo -- $(ls -l $p); $p -c "import sys; print(sys.path)"; done
– user.dz Nov 30 '16 at 10:32echo -- $(ls -l $p)
– why? It could be simplyls -l "$p"
(with added quotation to avoid escaping issues). – David Foerster Nov 30 '16 at 18:38echo; ls -l $p
could enough to get a readable output, I don't expect any executable have space in filename. – user.dz Nov 30 '16 at 18:53