1

I just started having a problem installing any package with pip, regardless of the version.

In all cases, I get an error with a similar template :

 ERROR: Command errored out with exit status 1: command: 'C:\Python27\python.exe' -c 'import sys, setuptools, tokenize; sys .argv[0] = '"'"'c:\\users\\me\\appdata\\local\\temp\\pip-req-build-n4skfi\\set up.py'"'"'; __file__='"'"'c:\\users\\me\\appdata\\local\\temp\\pip-req-build-n 4skfi\\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 'c:\users\me\appdata\local\temp\pip- pip-egg-info-wywu7x' cwd: c:\users\me\appdata\local\temp\pip-req-build-n4skfi\ Complete output (3 lines): Traceback (most recent call last): File "<string>", line 1, in <module> IOError: [Errno 2] No such file or directory: 'c:\\users\\me\\appdata\\loc al\\temp\\pip-req-build-n4skfi\\setup.py' ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check th e logs for full command output. 

What may be the cause of this problem?

Edit: There seems to be a problem with the script file pip-script. I just tried 'pip list' and got an error :

script file pip-script.py is not present 

On googling that, I found a number of sites, saying to use 'easy_install pip'. I tried that, but I get the same error.

script file pip-script.py is not present 

Is there another solution, and suggestions as to the cause(s)?

5
  • Enable verbose mode (pip -v ...), maybe it will contain some useful info. Commented Mar 3, 2021 at 18:48
  • Thanks but, that does not work. I get the error I mentioned in the edited OP. Commented Mar 3, 2021 at 19:08
  • What version of Python are you using? Commented Mar 3, 2021 at 19:10
  • The problem occurs with all of them. I have 2.7 amd 3.7 on my system, and I have 3.8 in anaconda, and an anaconda environment with 3.9. I also have a python environment with 3.6. Commented Mar 3, 2021 at 19:12
  • I'm going to restart my computer, and if that does not resolve the problem, I will try the suggestion here - stackoverflow.com/questions/46512000/… Commented Mar 3, 2021 at 19:25

1 Answer 1

1

Apparently, after rebooting my pc, pip works for python on my system. However, the problem still existed with the anaconda environment. In fact, the anaconda command shell refused to go to base, so I had to uninstall it, and reinstall. Fortunately, I was able to keep all my newly installed packages since, wisely, I created my environment outside anaconda.

However, the environment is corrupted, since I realize the 'pip-script.py' file was missing. After copying one from another environment, I had to install pip, since that was missing.

When I tried installing a package, I got the errors again, and the 'pip-script.py' file was not found. So apparently that anaconda environment is the problem, and I have to remove it. Should be a simple case of moving the files, recreating the environment, and moving the packages into the environment. I just need to make sure no corrupted files are copied.

I don't know what caused the corruption though.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.