Learn Python: Pipenv - Errors

Have been working through the Computer Science Pro Path for about a month and have hit my first real issue. Currently learning about Python Modules, specifially this exercise - https://www.codecademy.com/paths/computer-science/tracks/cspath-python-objects/modules/ed0912109b0137ded2c7e1e8f94094ed/videos/learn-python3-pipenv

I am able to follow all steps until we are to intsall Numpy. When installing numpy I run into an error installing dependacies from pipFile.lock. I have uninstalled pipenv and removed PATH, reinstalled using Administration cmd, but still run into the same error.

Please, help! Any help would be super appreciated!!

Here is a screenshot:

PS C:\Users\Rheannon\Desktop\project-1> pipenv install numpy
Installing numpy…
Adding numpy to Pipfile’s [packages]…
Installation Succeeded
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (456e4b)!
Installing dependencies from Pipfile.lock (456e4b)…
An error occurred while installing numpy==1.18.4 --hash=sha256:00d7b54c025601e28f468953d065b9b121ddca7fff30bed7be082d3656dd798d --hash=sha256:02ec9582808c4e48be4e93cd629c855e644882faf704bc2bd6bbf58c08a2a897 --hash=sha256:0e6f72f7bb08f2f350ed4408bb7acdc0daba637e73bce9f5ea2b207039f3af88 --hash=sha256:1be2e96314a66f5f1ce7764274327fd4fb9da58584eaff00b5a5221edefee7d6
–hash=sha256:2466fbcf23711ebc5daa61d28ced319a6159b260a18839993d871096d66b93f7 --hash=sha256:2b573fcf6f9863ce746e4ad00ac18a948978bb3781cffa4305134d31801f3e26 --hash=sha256:3f0dae97e1126f529ebb66f3c63514a0f72a177b90d56e4bce8a0b5def34627a --hash=sha256:50fb72bcbc2cf11e066579cb53c4ca8ac0227abb512b6cbc1faa02d1595a2a5d --hash=sha256:57aea170fb23b1fd54fa537359d90d383d9bf5937ee54ae8045a723caa5e0961 --hash=sha256:709c2999b6bd36cdaf85cf888d8512da7433529f14a3689d6e37ab5242e7add5 --hash=sha256:7d59f21e43bbfd9a10953a7e26b35b6849d888fc5a331fa84a2d9c37bd9fe2a2 --hash=sha256:904b513ab8fbcbdb062bed1ce2f794ab20208a1b01ce9bd90776c6c7e7257032 --hash=sha256:96dd36f5cdde152fd6977d1bbc0f0561bccffecfde63cd397c8e6033eb66baba --hash=sha256:9933b81fecbe935e6a7dc89cbd2b99fea1bf362f2790daf9422a7bb1dc3c3085 --hash=sha256:bbcc85aaf4cd84ba057decaead058f43191cc0e30d6bc5d44fe336dc3d3f4509 --hash=sha256:dccd380d8e025c867ddcb2f84b439722cf1f23f3a319381eac45fd077dee7170 --hash=sha256:e22cd0f72fc931d6abc69dc7764484ee20c6a60b0d0fee9ce0426029b1c1bdae --hash=sha256:ed722aefb0ebffd10b32e67f48e8ac4c5c4cf5d3a785024fdf0e9eb17529cd9d --hash=sha256:efb7ac5572c9a57159cf92c508aad9f856f1cb8e8302d7fdb99061dbe52d712c --hash=sha256:efdba339fffb0e80fcc19524e4fdbda2e2b5772ea46720c44eaac28096d60720 --hash=sha256:f22273dd6a403ed870207b853a856ff6327d5cbce7a835dfa0645b3fc00273ec! Will try again.
================================ 1/1 - 00:00:13
Installing initially failed dependencies…
[pipenv.exceptions.InstallError]: File “C:\Users\Rheannon\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pipenv\core.py”, line 1983, in do_install
[pipenv.exceptions.InstallError]: do_init(
[pipenv.exceptions.InstallError]: File “C:\Users\Rheannon\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pipenv\core.py”, line 1246, in do_init
[pipenv.exceptions.InstallError]: do_install_dependencies(
[pipenv.exceptions.InstallError]: File “C:\Users\Rheannon\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pipenv\core.py”, line 858, in do_install_dependencies
[pipenv.exceptions.InstallError]: batch_install(
[pipenv.exceptions.InstallError]: File “C:\Users\Rheannon\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pipenv\core.py”, line 763, in batch_install
[pipenv.exceptions.InstallError]: _cleanup_procs(procs, not blocking, failed_deps_queue, retry=retry)
[pipenv.exceptions.InstallError]: File “C:\Users\Rheannon\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pipenv\core.py”, line 681, in _cleanup_procs
[pipenv.exceptions.InstallError]: raise exceptions.InstallError(c.dep.name, extra=err_lines)
[pipenv.exceptions.InstallError]: [‘Collecting numpy==1.18.4’, ’ Using cached numpy-1.18.4-cp38-cp38-win_amd64.whl (12.8 MB)’, ‘Installing collected packages: numpy’]
[pipenv.exceptions.InstallError]: [“ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: ‘C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\\Lib\\site-packages\\numpy’”, ‘Consider using the --user option or check the permissions.’]
ERROR: ERROR: Package installation failed…
================================ 0/1 - 00:00:15

Please, help! Any help would be super appreciated!!

read the error message it tells you why and what to do
(and that is what you do with error messages in general)

This is the error I noticed and have been trying to resolve. I’ve used the --user option (at least I believe. I ran pip install --user pipenv) and have tried using Administrator cmd (it was suggested when I was searching for a solution). Am I missing something here?

[“ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: ‘C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qbz5n2kfra8p0\Lib\site-packages\numpy’”, ‘Consider using the --user option or check the permissions.’]

Not sure why you’re trying to install pipenv after having already done so

I’m trying to install Numpy and that is when I get this error. Up until I try and run pipenv install numpy I don’t run into any problems.

Oh you mean that’s how you previously installed pipenv?
It’s not pipenv that needs to be installed under your user, it’s numpy.

C:\Program Files doesn’t strike me as a location that pipenv should be wanting to modify

And no you shouldn’t be elevating permissions, you should be asking for fewer permissions, installing under your user rather than in a system directory. Maybe that’s the problem, having forced pipenv to install into a location which it then can’t modify under normal use.

Thanks for the clarification. I was able to successfully install numpy with pip install --user numpy. I think that installed under my user!

If pipenv was installed with an admin shell, then you might want to open an admin shell again and pip uninstall it and then redo it from a regular shell with --user same as you did with numpy
(really not sure why pipenv would be trying to modify C:\Program Files regadless of how pipenv was installed, but maybe it somehow has to do with where pipenv itself is installed)

you may or may not want pipenv to be in charge of the numpy installation for its environments

I suppose it’s also possible that you have multiple installations of pipenv and that you’re using the wrong one

Thanks for the advice. I originally installed pipenv without admin and then reinstalled with admin shell. I’ll do the process over in regular and see what happens!

What I would expect to happen, is that a virtual environment gets created by pipenv under your user, and then pipenv would install things there. Because that’s kind of the point, to create user-owned environments separate from the system one.

If I run pipenv install numpy, then I can look in my ~/Envs/projectname-LGPtqDP2 directory and find numpy’s files there

…anyway, no idea what you’ve been doing, and it’s on windows, and maybe you’ve got windows app store involved there somehow judging by some of those paths, which is terrifying, and I’ve no clue what pipenv attempts to do on windows, even though I’d like to think it does roughly the same thing as it would elsewhere.

That all makes sense to me. Honestly was getting pretty confused on what was going on.

I’ve had some other weird experiences installing bash and PyCharm. Just curious, what OS do you prefer?

I tried to reproduce this. Didn’t get exactly the same things to happen, but a guess is that you already had a virtual environment and that if you had removed it (pipenv --rm) pipenv would have done the right thing (your output in your first post does not show a environment being created, so maybe there was an already existing, no longer valid one)

As for OS, I use arch linux … I think windows’s problem is that there’s always a gui between you and the thing actually being done so the user ends up unable to look at and use things directly.

1 Like

Hey, thanks for the help with this. Just got back to it and was able to uninstall everything and start fresh. Following your advice I was able to get it all working first shot. I’m pretty sure your last post explained what I was doing to a tee.

I was running Ubuntu through a Virtual Box but when I started learning but it seemed easier to start with Windows… I’m pretty sure I am going to go back to Ubuntu and get out of my comfort zone.

Uhm yeah if you have that option then that’s just… plain easier. You probably don’t want anything from windows anyway.

Might want to use wsl (microsoft store -> ubuntu) instead of a vm though

Either way, what you’d do is use a network mount or in some other way shared directory to provide access for your text editor.

This might be worth looking into… I haven’t tried it because I don’t use vscode … https://code.visualstudio.com/docs/remote/wsl