Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Trouble importing modules on a new python version
#1
I'm using a Raspberry Pi, and NOOBS came pre-loaded with python3.5. Unfortuantely, a package that I need only works properly with 3.7, so I installed it doing the following:

wget https://www.python.org/ftp/python/3.7.2/...7.2.tar.xz
tar -xf Python-3.7.2.tar.xz
cd Python-3.7.2
sudo make -j 4
sudo make altinstall

Then I appended this line at the end of my .bashrc:

alias python3 = '/usr/local/bin/python35'

So now python 3.7 runs properly when I call python3, but the problem is that now whenever I use apt or pip to install a new package, I'm unable to import it from within python3.7. I am however able to import it if I run python3.5, so I know the packages are being installed. I suspect it's an issue with python3.7 looking for packages in the wrong place, but I'm not sure of whether I might need to edit the PYTHONPATH or something similar. I've found a few people online saying that editing it is a bad idea, so I'm just hoping for a bit of guidance there. Thanks!
Quote
#2
What is wwdw?
Quote
#3
Sorry, accidental post while trying to tab space those lines.

Also, that .bashrc line should be
alias python3 = '/usr/local/bin/python37' not
alias python3 = '/usr/local/bin/python35'
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  python modules davy_yg 1 177 Sep-25-2019, 03:14 AM
Last Post: metulburr
  update certbot's python version metulburr 0 144 Sep-19-2019, 11:51 AM
Last Post: metulburr
  Im using python crash course version 2 james_newbie 3 135 Sep-07-2019, 09:21 PM
Last Post: ichabod801
  Importing Custom Modules in Python 3 Flexico 1 250 Aug-24-2019, 08:11 PM
Last Post: snippsat
  importing datetime trouble Dixon 4 1,238 Aug-24-2019, 11:47 AM
Last Post: satishm
  Import Python Modules zowhair 4 406 Jun-27-2019, 06:30 AM
Last Post: Gribouillis
  importing modules PiaNa 1 221 Jun-24-2019, 12:50 PM
Last Post: ichabod801
  [split] Using this Python version of text2pdf jonsnow1221 1 265 May-07-2019, 07:48 PM
Last Post: micseydel
  Importing a CSV loops to infinity in python bluethundr 2 557 May-03-2019, 03:28 PM
Last Post: bluethundr
  Make bash call my own Python modules Pedroski55 10 874 Apr-22-2019, 04:04 PM
Last Post: snippsat

Forum Jump:


Users browsing this thread: 1 Guest(s)