1

When I pip install AnyPackage I receive output telling me that it is "Defaulting to user installation because normal site-packages is not writeable":

example of problem

I have tried uninstalling Python, but it does not solve the problem.

I am using an admin account on Home Edition, and running , (downloaded directly from python.org), installed using the "add to path" option.

It is worth noting that I can't access any package from , for instance:

not able to access package

P.S Why does it install the package in AppData\Roaming\Python\Python39\Scripts, when Python is installed to C:\Program Files\Python39?

As for my goal, I would like to avoid any future problems this might cause me.

I would also like to be able to create a virtual environment, using virtualenv.

4
  • Your issue is clearly shown in colored text in your submitted images! It specifically warns you that it may be prudent to add your \Scripts directory to %PATH%, it tells you that your files are being installed there, and yet you seem surprised when you cannot run the file located there! If you want to run those files without having to type C:\Users\Connor Gilbert\AppData\Roaming\Python\Python39\Scripts\ (and doublequote them), I would advise you to add the following via the GUI to the end of your current User Environment Path value(s), %AppData%\Python\Python39\Scripts.
    – Compo
    May 11, 2021 at 9:30
  • Thanks for your time compo, unfortunately, this did not solve either problem. only made the orange warning go away.
    – connor123
    May 13, 2021 at 7:08
  • If I run the command promt as admin for the pip install package. all problems are solved.
    – connor123
    May 13, 2021 at 7:25
  • I just posted a new answer here which may help: "Defaulting to user installation because normal site-packages is not writeable" python message
    – bitinerant
    May 24, 2022 at 21:17

2 Answers 2

0

For me not using my IDE with virtual environment solved the problem and to install all modules using administrator privileges.

1
  • 2
    Your answer lacks detail, especially as the OP does not mention an IDE. Could you please use the edit button to expand on your answer, in a way which correlates with the question(s) asked. Thank you.
    – Compo
    Aug 15, 2021 at 14:01
-2

Use bash to install packages instead of Powershell

3
  • 1
    Please provide an explanation to your answer
    – Sfili_81
    Jun 17, 2021 at 12:39
  • @Sfili_81 To use Powershell properly here you need to do some extra work. Powershell's ExecutionPolicy is Restricted by default for security concern. So, you have to set it unrestricted first. That's why I suggested the easiest fix. For more details explanation please check this post stackoverflow.com/questions/1365081/virtualenv-in-powershell Jun 30, 2021 at 9:18
  • @MdDelowerHossain Mine is set to RemoteSigned, and I'm still getting this error. Setting it to Unrestricted is just really really bad and shouldn't be done. May 4, 2022 at 3:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.