2

I am trying to install the package using pip3, for example, the following command:

sudo pip3 install testresources setuptools==49.6.0 

But, get the following error:

Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    from pip import main
ValueError: source code string cannot contain null bytes

What I have tried:

Remove pip3 by purge and install it again by sudo apt-get install python3-pip

If it helps, the python version is 3.6.9.

6
  • Possible duplicate of: stackoverflow.com/questions/31233777/… Commented Apr 25, 2021 at 1:12
  • 3
    @TheBotlyNoob Definitely it is not duplicate! The post that you have mentioned is about a graphic library in MacOS, but mine is about the installation of any package with pip3 in ubuntu! Commented Apr 25, 2021 at 1:14
  • Does this still occur if you do a single-user installation? pip3 install --user testresources setuptools==49.6.0 Commented Apr 25, 2021 at 1:25
  • it seems the pip3 is corrupted. It is not clear if it's the shortcut /usr/bin/pip3 or the pip module itself. Can you try running sudo python3 -m pip install <same packages>? Commented Apr 25, 2021 at 2:23
  • @Marat this command gets the same error! Commented Apr 25, 2021 at 14:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.