Python Forum
Wrong pip3 python location or new Version
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Wrong pip3 python location or new Version
#1
I'm in Ubuntu / Linux

I try to install python3.8.2 with the latest version.

before i install i had Version 3.5.2, and that works very well.

but now pip and pip3 is the same linked location:

pip -V
pip 20.0.2 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
pip3 -V
pip 20.0.2 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)

the problem is why i can't install any packages with the new version error message says: **

sudo pip3 install nltk

**

WARNING: The directory '/home/fredy/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting nltk
Downloading nltk-3.4.5.zip (1.5 MB)
|████████████████████████████████| 1.5 MB 2.3 MB/s
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-d0mx8gb1/nltk/setup.py'"'"'; __file__='"'"'/tmp/pip-install-d0mx8gb1/nltk/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-d0mx8gb1/nltk/pip-egg-info
cwd: /tmp/pip-install-d0mx8gb1/nltk/
Complete output (11 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/fredy/.local/lib/python3.8/site-packages/setuptools/__init__.py", line 19, in <module>
from setuptools.dist import Distribution
File "/home/fredy/.local/lib/python3.8/site-packages/setuptools/dist.py", line 34, in <module>
from setuptools import windows_support
File "/home/fredy/.local/lib/python3.8/site-packages/setuptools/windows_support.py", line 2, in <module>
import ctypes
File "/usr/local/lib/python3.8/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

(pip list)

Package Version
---------- -------
pip 20.0.2
setuptools 46.1.1

(pip3 list)

Package Version
---------- -------
pip 20.0.2
setuptools 46.1.1

step1:

how can i come back to python3 with pip3. ?

step2:

how can i fix the error so i can work with 3.8.2 ?

What will you do ? :)

Thanks for your time !
Reply
#2
I think the trace indicates that you need to run
pip3 install _ctypes

(Apr-02-2020, 02:36 PM)philgoetz Wrote: I think the trace indicates that you need to run
pip3 install _ctypes
That was wrong. ctypes is a module, not a package.
You can see this for info on it:

https://docs.python.org/3/library/ctypes...ule-ctypes

but I don't know how to install packages, and that documentation doesn't say where to get ctypes or how to install it.

I wish the admin would enable editing or deleting of posts more than 10 minutes after posting, so I could delete my first stupid reply.

(Apr-02-2020, 02:36 PM)philgoetz Wrote: but I don't know how to install packages,
should say "I don't know how to install modules.'

I went back to try to edit this almost immediately after posting it, and it said I'd posted it 31 minutes ago. The timestamping is wrong, so we can't edit posts EVER, let alone within a 10-minute window of posting.

I'm testing to see whether clicking the "reply to" to the initial post makes any difference wrt posting time.

I'm testing to see if "New Reply" will give me a reply that I can then edit or delete.

Nope. Once you've commented on a thread, any new comments on it will be incorporated under your previous comment, so you won't be able to edit or delete them, ever.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  run part of a script with a different version of Python jdog 2 394 Jan-09-2024, 08:49 PM
Last Post: jdog
  How to find out from outside Python (in Windows) the current version of Python? pstein 4 679 Oct-04-2023, 10:01 AM
Last Post: snippsat
  How to resolve version conflicts in Python? taeefnajib 0 873 Apr-27-2023, 08:37 PM
Last Post: taeefnajib
  Python venv and PIP version issue JanOlvegg 2 1,199 Feb-22-2023, 02:22 AM
Last Post: JanOlvegg
  Python Version upgrade nitinkukreja 1 852 Feb-04-2023, 10:27 PM
Last Post: Larz60+
  Am I wrong or is Udemy wrong? String Slicing! Mavoz 3 2,385 Nov-05-2022, 11:33 AM
Last Post: Mavoz
  Can't update new python version on Pycharm GOKUUUU 6 3,700 Jul-23-2022, 09:24 PM
Last Post: GOKUUUU
  ModuleNotFoundError: No module named '_struct' when starting pip3 yuhuihu 0 2,809 May-05-2022, 04:41 AM
Last Post: yuhuihu
  cmake and pip3 install warnings with python 3.10.2 cyrduf 0 1,840 Feb-26-2022, 01:08 PM
Last Post: cyrduf
  Building python (3.9.5) with different libexpat version (2.4.6) raghupcr 0 1,258 Feb-25-2022, 11:29 AM
Last Post: raghupcr

Forum Jump:

User Panel Messages

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