Python Forum
Trouble importing modules on a new python version
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!
Reply
#2
What is wwdw?
Recommended Tutorials:
Reply
#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'
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python version 3.11.15 install skip74 1 44 Apr-08-2026, 05:59 PM
Last Post: noisefloor
  Trouble Importing cell2location After Installation - Need Help haileyp 3 1,972 Jul-12-2025, 04:00 PM
Last Post: snippsat
  Conversion of Oracle PL/SQL(packages, functions, procedures) to python modules. DivyaKumar 3 9,718 Oct-01-2024, 03:32 PM
Last Post: Alex_Kirpichny
Bug Python 3.12 cannot import local python files as modules sunflowerdog 25 49,797 Jul-31-2024, 01:52 PM
Last Post: sunflowerdog
  How to find out from outside Python (in Windows) the current version of Python? pstein 5 4,540 Jun-28-2024, 07:02 AM
Last Post: Samuel34
  run part of a script with a different version of Python jdog 3 3,862 May-27-2024, 01:57 AM
Last Post: Alice12
  confusion on importing modules carter187 4 3,035 Mar-03-2024, 08:11 PM
Last Post: snippsat
  Trouble with installing python domingo251 2 2,012 Sep-23-2023, 12:03 AM
Last Post: ICanIBB
  How to resolve version conflicts in Python? taeefnajib 0 4,253 Apr-27-2023, 08:37 PM
Last Post: taeefnajib
  How to see the date of installation of python modules. newbieAuggie2019 4 7,672 Mar-31-2023, 12:40 PM
Last Post: newbieAuggie2019

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020