Hello Debian User forum,
I m trying to use a python module in python3.4 but I did the whole PythonPath variable thing in my .bashrc file and the module only works with python 2.7. If I run python3.4 interactively and try to import the module, the interpreter tells me there s no such module
In detail, assume $ is a bash prompt, # is a comment, >>> is python prompt; I did all of this:
$ emacsclient ~/.bashrc #yes i use emacs as my editor server
In emacs now:
export PYTHONPATH="${PYTHONPATH}:path/to/module"
Close emacs
$ source ~/.bashrc
$ python2.7
'>>>' import Module as M
'>>>' # it works
However if I do
$python3.4
'>>>' import Module as M
error no such module
What is going here and how do i get python3.4 to find this module. Also, I got it from a github repo and so I didn't use APT. I have a hunch thats going to be very important.
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Module is found by python2.7 but not python3.4 in debian 8
-
- Posts: 3
- Joined: 2013-09-17 00:26
-
- Posts: 124
- Joined: 2015-01-24 03:10
Re: Module is found by python2.7 but not python3.4 in debian
There's a good chance that module doesn't exist for python 3, or has a different name. I can't tell you how many times this has tripped me up when translating between versions...
It'd help, though, if you said exactly which module it is.
It'd help, though, if you said exactly which module it is.
-
- Posts: 3
- Joined: 2013-09-17 00:26
Re: Module is found by python2.7 but not python3.4 in debian
Thanks for the reply.
Yeah I should ve mentioned that in the OP. Its networkx, a graph data structures/algos package.
Also I went looking in the Debian Python Policy Appendix and that really didn't help. I really didn't know what I was looking for.
Yeah I should ve mentioned that in the OP. Its networkx, a graph data structures/algos package.
Also I went looking in the Debian Python Policy Appendix and that really didn't help. I really didn't know what I was looking for.
-
- Posts: 124
- Joined: 2015-01-24 03:10
Re: Module is found by python2.7 but not python3.4 in debian
Yep, there's definitely two versions--one for python2, and one for python3.
Try installing the python 3 one:
Hopefully it should import as normal afterwards.
Cheers!
Fred
Try installing the python 3 one:
Code: Select all
sudo apt-get install python3-networkx
Cheers!
Fred
-
- Posts: 3
- Joined: 2013-09-17 00:26
Re: Module is found by python2.7 but not python3.4 in debian
oh..thats great. thanks for the help!fred barclay wrote:Yep, there's definitely two versions--one for python2, and one for python3.
Try installing the python 3 one:Hopefully it should import as normal afterwards.Code: Select all
sudo apt-get install python3-networkx
Cheers!
Fred
-
- Posts: 124
- Joined: 2015-01-24 03:10