1

I am using Python 3.8 and Pip 3.8

I cannot seem to install certain modules using pip. For example, when attempting to install the keras module:

(venv) C:\Users\Spencer Pruitt\PycharmProjects\MNIST Analyzer>pip install keras
Collecting keras
  Using cached https://files.pythonhosted.org/packages/ad/fd/6bfe87920d7f4fd475acd28500a42482b6b84479832bdc0fe9e589a60ceb/Keras-2.3.1-py2.py3-none-any.whl
Collecting h5py (from keras)
  Using cached https://files.pythonhosted.org/packages/5f/97/a58afbcf40e8abecededd9512978b4e4915374e5b80049af082f49cebe9a/h5py-2.10.0.tar.gz
Collecting keras-preprocessing>=1.0.5 (from keras)
  Using cached https://files.pythonhosted.org/packages/28/6a/8c1f62c37212d9fc441a7e26736df51ce6f0e38455816445471f10da4f0a/Keras_Preprocessing-1.1.0-py2.py3-none-any.whl
Collecting numpy>=1.9.1 (from keras)
  Using cached https://files.pythonhosted.org/packages/ff/59/d3f6d46aa1fd220d020bdd61e76ca51f6548c6ad6d24ddb614f4037cf49d/numpy-1.17.4.zip
Collecting six>=1.9.0 (from keras)
  Using cached https://files.pythonhosted.org/packages/65/26/32b8464df2a97e6dd1b656ed26b2c194606c16fe163c695a992b36c11cdf/six-1.13.0-py2.py3-none-any.whl
Collecting pyyaml (from keras)
  Using cached https://files.pythonhosted.org/packages/29/16/e4d675da1275a3aabd5e2a35e868273ba3f4859993acb55e77792f806315/PyYAML-5.1.2-cp38-cp38m-win32.whl
Collecting scipy>=0.14 (from keras)
  Using cached https://files.pythonhosted.org/packages/a7/5c/495190b8c7cc71977c3d3fafe788d99d43eeb4740ac56856095df6a23fbd/scipy-1.3.3.tar.gz
  Installing build dependencies ... error
  Complete output from command "C:\Users\Spencer Pruitt\PycharmProjects\MNIST Analyzer\venv\Scripts\python.exe" "C:\Users\Spencer Pruitt\PycharmProjects\MNIST Analyzer\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip" install --ignore-installed --no-user --prefix "C:\U
sers\Spencer Pruitt\AppData\Local\Temp\pip-build-env-qcebzlj8\overlay" --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- wheel setuptools Cython>=0.29.13 "numpy==1.13.3; python_version=='3.5' and platform_system!='AIX'" "n
umpy==1.13.3; python_version=='3.6' and platform_system!='AIX'" "numpy==1.14.5; python_version=='3.7' and platform_system!='AIX'" "numpy==1.17.3; python_version>='3.8' and platform_system!='AIX'" "numpy==1.16.0; python_version=='3.5' and platform_system=='AIX'" "numpy
==1.16.0; python_version=='3.6' and platform_system=='AIX'" "numpy==1.16.0; python_version=='3.7' and platform_system=='AIX'" "numpy==1.17.3; python_version>='3.8' and platform_system=='AIX'":
  Ignoring numpy: markers 'python_version == "3.5" and platform_system != "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.6" and platform_system != "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.7" and platform_system != "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.5" and platform_system == "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.6" and platform_system == "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.7" and platform_system == "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version >= "3.8" and platform_system == "AIX"' don't match your environment
  Collecting wheel
    Using cached https://files.pythonhosted.org/packages/00/83/b4a77d044e78ad1a45610eb88f745be2fd2c6d658f9798a15e384b7d57c9/wheel-0.33.6-py2.py3-none-any.whl
  Collecting setuptools
    Using cached https://files.pythonhosted.org/packages/9e/d5/444a443d890f09fc1ca1a2c3c9fc7e84cb148177b05ac94fe5084e3d9abb/setuptools-42.0.1-py2.py3-none-any.whl
  Collecting Cython>=0.29.13
    Using cached https://files.pythonhosted.org/packages/9c/9b/706dac7338c2860cd063a28cdbf5e9670995eaea408abbf2e88ba070d90d/Cython-0.29.14.tar.gz
  Collecting numpy==1.17.3
    Using cached https://files.pythonhosted.org/packages/b6/d6/be8f975f5322336f62371c9abeb936d592c98c047ad63035f1b38ae08efe/numpy-1.17.3.zip
  Installing collected packages: wheel, setuptools, Cython, numpy
    Running setup.py install for Cython: started
      Running setup.py install for Cython: finished with status 'done'
    Running setup.py install for numpy: started
      Running setup.py install for numpy: still running...
      Running setup.py install for numpy: finished with status 'done'
  Could not install packages due to an EnvironmentError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '"C:'


  ----------------------------------------
Command ""C:\Users\Spencer Pruitt\PycharmProjects\MNIST Analyzer\venv\Scripts\python.exe" "C:\Users\Spencer Pruitt\PycharmProjects\MNIST Analyzer\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip" install --ignore-installed --no-user --prefix "C:\Users\Spencer Pruitt\Ap
pData\Local\Temp\pip-build-env-qcebzlj8\overlay" --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- wheel setuptools Cython>=0.29.13 "numpy==1.13.3; python_version=='3.5' and platform_system!='AIX'" "numpy==1.13.3; python_v
ersion=='3.6' and platform_system!='AIX'" "numpy==1.14.5; python_version=='3.7' and platform_system!='AIX'" "numpy==1.17.3; python_version>='3.8' and platform_system!='AIX'" "numpy==1.16.0; python_version=='3.5' and platform_system=='AIX'" "numpy==1.16.0; python_versi
on=='3.6' and platform_system=='AIX'" "numpy==1.16.0; python_version=='3.7' and platform_system=='AIX'" "numpy==1.17.3; python_version>='3.8' and platform_system=='AIX'"" failed with error code 1 in None

A similar problem occurs when I attempted to install numpy.

(venv) C:\Users\Spencer Pruitt\PycharmProjects\MNIST Analyzer>pip install numpy
Collecting numpy
  Using cached https://files.pythonhosted.org/packages/ff/59/d3f6d46aa1fd220d020bdd61e76ca51f6548c6ad6d24ddb614f4037cf49d/numpy-1.17.4.zip
Installing collected packages: numpy
  Running setup.py install for numpy ... done
Could not install packages due to an EnvironmentError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '"C:'

Expected behavior

The installation process would complete satisfactorily and the command prompt would read "[module name] is ready to use!" or something to that effect.

Misc. I am new to programming and am not familiar with the terminology being thrown around here. I am entirely self taught and this is my first time using Python. I would sincerely appreciate someone giving me a run-down of how to install these modules properly or at least get pip to work. I've been looking at other issues, but the answers do not make sense to me or the problems do not appear to be the same as mine.

Thank you!

Spencer Pruitt
  • 11
  • 1
  • 1
  • 3

2 Answers2

1

Please use version <3.7 of python for numpy installation. Or see module/package required which version of python. So, just upgrade and degrade the python version to work with packages.

ANIL PATEL
  • 673
  • 7
  • 16
-1

See this thread re: spaces in path causing issues with installing numpy. Any possibility of moving your virtual environment/project to something like "C:\Temp\MNIST_Analyzer"?

This thread for getting around spaces in the path is for Mac, but may be relevant.

  • thank you for response! I've looked at that thread, but I honestly don't really understand the jargon. Could you dumb it down for me? Do I just need to change where the file is located? – Spencer Pruitt Nov 27 '19 at 20:46
  • I tried to replicate your issue by creating a fresh venv in a brand new folder w/ spaces, then `pip install keras`. No errors. What is the output of `pip --version`? The whitespace issue was [apparently fixed](https://github.com/pypa/virtualenv/issues/53#issuecomment-434461292) in pip 10.0.0. Try `python -m pip install --upgrade pip`, then retry the keras install. – Thomas Green Nov 27 '19 at 21:14
  • I have just run through the same steps on a machine with older versions of Python and `pip`, where `pip` is version 9.0.1, and I still had no errors. I am on Win10. I have to admit that the references to AIX (an IBM Unix variant) are throwing me. I would also try not using cached packages: `pip --no-cache-dir install keras` . – Thomas Green Nov 27 '19 at 23:09
  • The pip version is 19.0.3, the Python version is 3.80 – Spencer Pruitt Nov 27 '19 at 23:16
  • I just reinstalled PyCharm and Python and got numpy and pandas to install without issue. Keras failed to install once more. – Spencer Pruitt Nov 27 '19 at 23:22
  • Ran through creating a virtual environment and installing `numpy`, `pandas`, and `keras` - in that order - on a third (Win8) machine with no errors. I have not installed PyCharm, but I can't see where that would introduce issues. Are the errors with the `keras` install similar to what you saw before? – Thomas Green Nov 27 '19 at 23:58
  • The keras problems stayed the same. I decided to see if using an alternate installer would work. I ended up installing Anaconda and using the Anaconda Navigator to install the modules I need. Worked like a charm. I still don't know why it wasn't working just in PyCharm itself. – Spencer Pruitt Nov 28 '19 at 13:09
  • Glad you're able to move forward. – Thomas Green Nov 28 '19 at 16:27