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…
Success!
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.’]
[/quote]

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

i tried installing numpy but keep getting error not installing can someone please check and let me know

pip --version is fine
pipenv --version is fine
pipenv install numpy

$ pipenv install numpy
Installing numpy…
Error: An error occurred while installing numpy!
Error text: Collecting numpy
Using cached numpy-1.19.2.zip (7.3 MB)
Installing build dependencies: started
Installing build dependencies: finished with status ‘done’
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status ‘done’
Preparing wheel metadata: started
Preparing wheel metadata: finished with status ‘error’

ERROR: Command errored out with exit status 1:
 command: 'C:\Users\atif\.virtualenvs\project_1-3fNVovIR\Scripts\python.exe' 'C:\Users\atif\.virtualenvs\project_1-3fNVovIR\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\atif\AppData\Local\Temp\tmpud1vgfzm'
     cwd: C:\Users\atif\AppData\Local\Temp\pip-install-uih2ajzb\numpy
Complete output (200 lines):
Running from numpy source directory.
setup.py:470: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
  run_build = parse_setuppy_commands()
Processing numpy/random\_bounded_integers.pxd.in
Processing numpy/random\bit_generator.pyx
Processing numpy/random\mtrand.pyx
Processing numpy/random\_bounded_integers.pyx.in
Processing numpy/random\_common.pyx
Processing numpy/random\_generator.pyx
Processing numpy/random\_mt19937.pyx
Processing numpy/random\_pcg64.pyx
Processing numpy/random\_philox.pyx
Processing numpy/random\_sfc64.pyx
Cythonizing sources
blas_opt_info:
blas_mkl_info:
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
  libraries mkl_rt not found in ['C:\\Users\\atif\\.virtualenvs\\project_1-3fNVovIR\\lib', 'C:\\', 'C:\\Users\\atif\\miniconda3\\Library\\lib']
  NOT AVAILABLE

blis_info:
  libraries blis not found in ['C:\\Users\\atif\\.virtualenvs\\project_1-3fNVovIR\\lib', 'C:\\', 'C:\\Users\\atif\\miniconda3\\Library\\lib']
  NOT AVAILABLE

openblas_info:
  libraries openblas not found in ['C:\\Users\\atif\\.virtualenvs\\project_1-3fNVovIR\\lib', 'C:\\', 'C:\\Users\\atif\\miniconda3\\Library\\lib']
get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']'
customize GnuFCompiler
Could not locate executable g77
Could not locate executable f77
customize IntelVisualFCompiler
Could not locate executable ifort
Could not locate executable ifl
customize AbsoftFCompiler
Could not locate executable f90
customize CompaqVisualFCompiler
Found executable C:\Git\usr\bin\DF.exe
customize IntelItaniumVisualFCompiler
Could not locate executable efl
customize Gnu95FCompiler
Could not locate executable gfortran
Could not locate executable f95
customize G95FCompiler
Could not locate executable g95
customize IntelEM64VisualFCompiler
customize IntelEM64TFCompiler
Could not locate executable efort
Could not locate executable efc
customize PGroupFlangCompiler
Could not locate executable flang
don't know how to compile Fortran code on platform 'nt'
  NOT AVAILABLE

atlas_3_10_blas_threads_info:
Setting PTATLAS=ATLAS
  libraries tatlas not found in ['C:\\Users\\atif\\.virtualenvs\\project_1-3fNVovIR\\lib', 'C:\\', 'C:\\Users\\atif\\miniconda3\\Library\\lib']
  NOT AVAILABLE

atlas_3_10_blas_info:
  libraries satlas not found in ['C:\\Users\\atif\\.virtualenvs\\project_1-3fNVovIR\\lib', 'C:\\', 'C:\\Users\\atif\\miniconda3\\Library\\lib']
  NOT AVAILABLE

atlas_blas_threads_info:
Setting PTATLAS=ATLAS
  libraries ptf77blas,ptcblas,atlas not found in ['C:\\Users\\atif\\.virtualenvs\\project_1-3fNVovIR\\lib', 'C:\\', 'C:\\Users\\atif\\miniconda3\\Library\\lib']
  NOT AVAILABLE

atlas_blas_info:
  libraries f77blas,cblas,atlas not found in ['C:\\Users\\atif\\.virtualenvs\\project_1-3fNVovIR\\lib', 'C:\\', 'C:\\Users\\atif\\miniconda3\\Library\\lib']
  NOT AVAILABLE

accelerate_info:
  NOT AVAILABLE

C:\Users\atif\AppData\Local\Temp\pip-install-uih2ajzb\numpy\numpy\distutils\system_info.py:1914: UserWarning:
    Optimized (vendor) Blas libraries are not found.
    Falls back to netlib Blas library which has worse performance.
    A better performance should be easily gained by switching
    Blas library.
  if self._calc_info(blas):
blas_info:
  libraries blas not found in ['C:\\Users\\atif\\.virtualenvs\\project_1-3fNVovIR\\lib', 'C:\\', 'C:\\Users\\atif\\miniconda3\\Library\\lib']
  NOT AVAILABLE

C:\Users\atif\AppData\Local\Temp\pip-install-uih2ajzb\numpy\numpy\distutils\system_info.py:1914: UserWarning:
    Blas (http://www.netlib.org/blas/) libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [blas]) or by setting
    the BLAS environment variable.
  if self._calc_info(blas):
blas_src_info:
  NOT AVAILABLE

C:\Users\atif\AppData\Local\Temp\pip-install-uih2ajzb\numpy\numpy\distutils\system_info.py:1914: UserWarning:
    Blas (http://www.netlib.org/blas/) sources not found.
    Directories to search for the sources can be specified in the
    numpy/distutils/site.cfg file (section [blas_src]) or by setting
    the BLAS_SRC environment variable.
  if self._calc_info(blas):
  NOT AVAILABLE

non-existing path in 'numpy\\distutils': 'site.cfg'
lapack_opt_info:
lapack_mkl_info:
  libraries mkl_rt not found in ['C:\\Users\\atif\\.virtualenvs\\project_1-3fNVovIR\\lib', 'C:\\', 'C:\\Users\\atif\\miniconda3\\Library\\lib']
  NOT AVAILABLE

openblas_lapack_info:
  libraries openblas not found in ['C:\\Users\\atif\\.virtualenvs\\project_1-3fNVovIR\\lib', 'C:\\', 'C:\\Users\\atif\\miniconda3\\Library\\lib']
  NOT AVAILABLE

openblas_clapack_info:
  libraries openblas,lapack not found in ['C:\\Users\\atif\\.virtualenvs\\project_1-3fNVovIR\\lib', 'C:\\', 'C:\\Users\\atif\\miniconda3\\Library\\lib']
  NOT AVAILABLE

flame_info:
  libraries flame not found in ['C:\\Users\\atif\\.virtualenvs\\project_1-3fNVovIR\\lib', 'C:\\', 'C:\\Users\\atif\\miniconda3\\Library\\lib']
  NOT AVAILABLE

atlas_3_10_threads_info:
Setting PTATLAS=ATLAS
  libraries lapack_atlas not found in C:\Users\atif\.virtualenvs\project_1-3fNVovIR\lib
  libraries tatlas,tatlas not found in C:\Users\atif\.virtualenvs\project_1-3fNVovIR\lib
  libraries lapack_atlas not found in C:\
  libraries tatlas,tatlas not found in C:\
  libraries lapack_atlas not found in C:\Users\atif\miniconda3\Library\lib
  libraries tatlas,tatlas not found in C:\Users\atif\miniconda3\Library\lib
<class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
  NOT AVAILABLE

atlas_3_10_info:
  libraries lapack_atlas not found in C:\Users\atif\.virtualenvs\project_1-3fNVovIR\lib
  libraries satlas,satlas not found in C:\Users\atif\.virtualenvs\project_1-3fNVovIR\lib
  libraries lapack_atlas not found in C:\
  libraries satlas,satlas not found in C:\
  libraries lapack_atlas not found in C:\Users\atif\miniconda3\Library\lib
  libraries satlas,satlas not found in C:\Users\atif\miniconda3\Library\lib
<class 'numpy.distutils.system_info.atlas_3_10_info'>
  NOT AVAILABLE

atlas_threads_info:
Setting PTATLAS=ATLAS
  libraries lapack_atlas not found in C:\Users\atif\.virtualenvs\project_1-3fNVovIR\lib
  libraries ptf77blas,ptcblas,atlas not found in C:\Users\atif\.virtualenvs\project_1-3fNVovIR\lib
  libraries lapack_atlas not found in C:\
  libraries ptf77blas,ptcblas,atlas not found in C:\
  libraries lapack_atlas not found in C:\Users\atif\miniconda3\Library\lib
  libraries ptf77blas,ptcblas,atlas not found in C:\Users\atif\miniconda3\Library\lib
<class 'numpy.distutils.system_info.atlas_threads_info'>
  NOT AVAILABLE

atlas_info:
  libraries lapack_atlas not found in C:\Users\atif\.virtualenvs\project_1-3fNVovIR\lib
  libraries f77blas,cblas,atlas not found in C:\Users\atif\.virtualenvs\project_1-3fNVovIR\lib
  libraries lapack_atlas not found in C:\
  libraries f77blas,cblas,atlas not found in C:\
  libraries lapack_atlas not found in C:\Users\atif\miniconda3\Library\lib
  libraries f77blas,cblas,atlas not found in C:\Users\atif\miniconda3\Library\lib
<class 'numpy.distutils.system_info.atlas_info'>
  NOT AVAILABLE

lapack_info:
  libraries lapack not found in ['C:\\Users\\atif\\.virtualenvs\\project_1-3fNVovIR\\lib', 'C:\\', 'C:\\Users\\atif\\miniconda3\\Library\\lib']
  NOT AVAILABLE

C:\Users\atif\AppData\Local\Temp\pip-install-uih2ajzb\numpy\numpy\distutils\system_info.py:1748: UserWarning:
    Lapack (http://www.netlib.org/lapack/) libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [lapack]) or by setting
    the LAPACK environment variable.
  return getattr(self, '_calc_info_{}'.format(name))()
lapack_src_info:
  NOT AVAILABLE

C:\Users\atif\AppData\Local\Temp\pip-install-uih2ajzb\numpy\numpy\distutils\system_info.py:1748: UserWarning:
    Lapack (http://www.netlib.org/lapack/) sources not found.
    Directories to search for the sources can be specified in the
    numpy/distutils/site.cfg file (section [lapack_src]) or by setting
    the LAPACK_SRC environment variable.
  return getattr(self, '_calc_info_{}'.format(name))()
  NOT AVAILABLE

numpy_linalg_lapack_lite:
  FOUND:
    language = c
    define_macros = [('HAVE_BLAS_ILP64', None), ('BLAS_SYMBOL_SUFFIX', '64_')]

c:\users\atif\appdata\local\programs\python\python39\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
  warnings.warn(msg)
running dist_info
running build_src
build_src
building py_modules sources
creating build
creating build\src.win-amd64-3.9
creating build\src.win-amd64-3.9\numpy
creating build\src.win-amd64-3.9\numpy\distutils
building library "npymath" sources
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------

ERROR: Command errored out with exit status 1: ‘C:\Users\atif.virtualenvs\project_1-3fNVovIR\Scripts\python.exe’ ‘C:\Users\atif.virtualenvs\project_1-3fNVovIR\lib\site-packages\pip_vendor\pep517_in_process.py’ prepare_metadata_for_build_wheel ‘C:\Users\atif\AppData\Local\Temp\tmpud1vgfzm’ Check the logs for full command output.

Installation Failed

i followed the video but its not installing

I will wait now

It seems like a few libraries are missing or misplaced. This line in the message might be a good place to start though-

error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/

hi

thanks for your reply, but i am still struggling here

I have installed
pipenv install requests => worked fine
but when i am installing
pipenv install numpy => not working
i tried the following command
conda install numpy => not working

i have tried all these commands in GIT BASH also same thing
NUMPY not installing new to this PYTHON

but struggling

Please help