Issue with Python

Mats Wichmann mats at wichmann.us
Fri Oct 23 13:32:04 EDT 2020


On 10/23/20 3:52 AM, Ifeanyi Obinelo wrote:
> Hello! I am a Python programmer and I love the language. However, I
> installed Python 3.9 and suddenly, pip does not install Python libraries
> anymore. It says that I need Visual Studio C++ 2014 and exits with:
> 
> "ERROR: Command errored out with exit status 1:..error: Microsoft Visual
> C++ 14.0 is required. Get it with "Build Tools for Visual Studio":
> https://visualstudio.microsoft.com/downloads/"
> (The complete output is about 302 lines long. I will attach at the end of
> the email.)
> 
> But I never needed Visual C++ 14 to install modules. Plus I have a bunch of
> C++ redistributables (but not 14). Is there any thing I can do to fix this?
> 
> Also, is there any way to carry over my libraries and modules from my
> previous Python installation (Python 3.8.5)? Or do I need to manually
> reinstall them?

Sometimes it's good to be a little patient!

*Some* modules, certainly not all, use compiled binary components.
Usually if they're big and consider they have performance-critical
elements, so they use the C API to make binary bits.  When pip goes to
install, it tries to find a wheel that matches your configuration.  If
there are no binary bits, an "any" type wheel will work fine, and there
are no issues.  If there are binary bits, it looks for a combination of
python version, architecture, and maybe bit-ness.  Failing to find a
suitable wheel, it pulls the source distribution and tries to install
that (by calling setup.py), and that will try to compile.

Since Windows doesn't come with a C compiler by default, that fails for
you. You could be ambitious and install Visual Studio Build Tools
(Community edition) or some such, and hope it works; it usually doesn't
without further setup.

Check if modules you care about exist for 3.9 by searching for them on
pypi.org and clicking on Download to see the available versions.  The
projects you care about will inevitably catch up, but it's still early
days for 3.9 and they have their own release processes to go through.

Or you can look on an unofficial site that does early builds - take to
heart the warning about the unsupported nature of these and tread carefully:

https://www.lfd.uci.edu/~gohlke/pythonlibs/#scikit-image

Or... stick with 3.8 for a while longer, there's nothing at all wrong
with 3.8!

"Do I need to manually reinstall" - get pip to dump out the modules into
a requirements.txt file, and use that to populate your new environment.
Then at least it won't be manual.



More information about the Python-list mailing list