Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
site-packages issue
#4
(Jul-07-2022, 12:31 PM)deanhystad Wrote: I do not believe there are two Python's installed. My guess is that the original install was performed as administrator and is shared. If you install a package as a user, you do not have permission to modify the site packages folder, so windows creates a site packages folder under your user\AppData folder.
Yes,of course when think of it so is that the reason,i mostly use pyenv then issues like this is none existing.

Addition info to what deanhystad has posted.
If use --user flag it will always use ./.local/lib/python3.10 then avoid permission issues.
python3.10 -m pip install --user hug
As mention make a virtual environment and use that as main version.
Example.
# Make an activate 
tom@tom-VirtualBox:~$ python -m venv new_python
tom@tom-VirtualBox:~$ cd new_python/
tom@tom-VirtualBox:~/new_python$ source bin/activate

# Now python and pip point to this folder
(new_python) tom@tom-VirtualBox:~/new_python$ which python
/home/tom/new_python/bin/python
(new_python) tom@tom-VirtualBox:~/new_python$ which pip
/home/tom/new_python/bin/pip

# Install now will only use this folder
(new_python) tom@tom-VirtualBox:~/new_python$ pip install hug
Collecting hug
  Downloading hug-2.6.1-py2.py3-none-any.whl (75 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 75.1/75.1 KB 1.4 MB/s eta 0:00:00
Collecting falcon==2.0.0
  Downloading falcon-2.0.0-py2.py3-none-any.whl (163 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 164.0/164.0 KB 2.7 MB/s eta 0:00:00
Collecting requests
  Downloading requests-2.28.1-py3-none-any.whl (62 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 KB 2.2 MB/s eta 0:00:00
Collecting urllib3<1.27,>=1.21.1
  Downloading urllib3-1.26.10-py2.py3-none-any.whl (139 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 139.2/139.2 KB 2.5 MB/s eta 0:00:00
Collecting certifi>=2017.4.17
  Downloading certifi-2022.6.15-py3-none-any.whl (160 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 160.2/160.2 KB 13.8 MB/s eta 0:00:00
Collecting idna<4,>=2.5
  Using cached idna-3.3-py3-none-any.whl (61 kB)
Collecting charset-normalizer<3,>=2
  Downloading charset_normalizer-2.1.0-py3-none-any.whl (39 kB)
Installing collected packages: urllib3, idna, falcon, charset-normalizer, certifi, requests, hug
Successfully installed certifi-2022.6.15 charset-normalizer-2.1.0 falcon-2.0.0 hug-2.6.1 idna-3.3 requests-2.28.1 urllib3-1.26.10

# Test
(new_python) tom@tom-VirtualBox:~/new_python$ python
Python 3.10.5 (main, Jun 23 2022, 10:51:05) [GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import hug
>>> 
>>> hug.__version__
'2.6.1'
>>> exit()
(new_python) tom@tom-VirtualBox:~/new_python$ 

My tutorial about pyenv Simple Python Version Management
Larz60+ likes this post
Reply


Messages In This Thread
site-packages issue - by paulgureghian - Jul-07-2022, 12:35 AM
RE: site-packages issue - by snippsat - Jul-07-2022, 11:19 AM
RE: site-packages issue - by deanhystad - Jul-07-2022, 12:31 PM
RE: site-packages issue - by snippsat - Jul-07-2022, 04:15 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Troubleshooting site packages ('h5py' to be specific) aukhare 2 2,138 Nov-02-2020, 03:04 PM
Last Post: snippsat
  site packages, python 3.8 Dixon 12 6,846 Feb-01-2020, 05:32 PM
Last Post: Dixon
  Site packages, Python 3.8 Dixon 2 2,646 Jan-18-2020, 10:42 PM
Last Post: Dixon
  Installing PIP packages issue Renym 2 3,166 Dec-09-2019, 04:44 PM
Last Post: Axel_Erfurt

Forum Jump:

User Panel Messages

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