LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-17-2021, 01:17 PM   #1
redneonglow
Member
 
Registered: Feb 2020
Location: PA
Distribution: Gentoo, Slackware
Posts: 75

Rep: Reputation: 24
Question Python 3.10: Locally installed modules not in path


After Slackware's upgrade to Python 3.10, modules installed locally by pip3 are not detected.

Running python3 and typing "sys.path" does not show $HOME/.local/lib64/python3.10/site-packages.

In order to have the locally installed modules detected by Python programs, I have to add $HOME/.local/lib64/python3.10/site-packages to the PYTHONPATH variable.

Last edited by redneonglow; 10-17-2021 at 02:21 PM. Reason: lib64
 
Old 10-17-2021, 04:47 PM   #2
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
I've started using pipenv for my various python projects.
 
1 members found this post helpful.
Old 10-17-2021, 08:23 PM   #3
andrew.46
Senior Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 1,365

Rep: Reputation: 493Reputation: 493Reputation: 493Reputation: 493Reputation: 493
Thanks for finding the fix for this issue which I have also bumped into elsewhere on these Forums...
 
Old 11-07-2021, 10:40 AM   #4
redneonglow
Member
 
Registered: Feb 2020
Location: PA
Distribution: Gentoo, Slackware
Posts: 75

Original Poster
Rep: Reputation: 24
This is no longer an issue after the downgrade back to python 3.9.
 
Old 11-07-2021, 12:19 PM   #5
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
Quote:
Originally Posted by redneonglow View Post
In order to have the locally installed modules detected by Python programs, I have to add $HOME/.local/lib64/python3.10/site-packages to the PYTHONPATH variable.
Bad idea as order in PATH matters. Which is crucial in case of version conflict between locally and system wide installed python scripts. It is most problematic using pip as common user. You don't have write access so all modules are installed locally. I don't think there is any good solution. Just one has to be careful.

Edit: good example for python app which should be placed unde $HOME/.local/bin is youtube-dl. It needs frequent updates. And it can check for new updates itself.

Last edited by igadoter; 11-07-2021 at 12:26 PM.
 
1 members found this post helpful.
  


Reply

Tags
python, slackware, slackware -current, slackware 15.0



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to mount one directory in a path locally, and the rest over NFS? bbarker88 Linux - Newbie 5 04-09-2020 04:37 PM
LXer: Python Python Python (aka Python 3) LXer Syndicated Linux News 0 08-05-2009 08:30 PM
CVS modules can be checked out locally, but not over pserver..what has to be changed? CaptainRandom Programming 2 06-23-2004 08:03 AM
Re: modprobe: Note: /etc/modules.conf is more recent than lib/modules/2.4.9/modules.d Andy.M Linux - General 1 01-24-2002 01:50 AM
Re: modprobe: Note: /etc/modules.conf is more recent than lib/modules/2.4.9/modules.d Andy.M Linux - Newbie 2 01-24-2002 01:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration