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.

Compo
  • 36,585
  • 5
  • 27
  • 39
connor123
  • 21
  • 1
  • 1
  • 6
  • 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 '21 at 09:30
  • Thanks for your time compo, unfortunately, this did not solve either problem. only made the orange warning go away. – connor123 May 13 '21 at 07:08
  • If I run the command promt as admin for the pip install package. all problems are solved. – connor123 May 13 '21 at 07:25
  • I just posted a new answer here which may help: ["Defaulting to user installation because normal site-packages is not writeable" python message](https://stackoverflow.com/questions/65808972) – bitinerant May 24 '22 at 21:17

2 Answers2

0

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

Denis13
  • 11
  • 3
  • 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 '21 at 14:01
-2

Use bash to install packages instead of Powershell

  • 1
    Please provide an explanation to your answer – Sfili_81 Jun 17 '21 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 https://stackoverflow.com/questions/1365081/virtualenv-in-powershell – Md Delower Hossain Jun 30 '21 at 09: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. – gargoylebident May 04 '22 at 03:11