Python Forum
Wrong pip3 python location or new Version - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Wrong pip3 python location or new Version (/thread-25235.html)



Wrong pip3 python location or new Version - 007fred50 - Mar-24-2020

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 !


RE: Wrong pip3 python location or new Version - philgoetz - Apr-02-2020

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.html#module-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.