Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python official installer missing python27.dll

I installed Python 2.7 32-bit on Windows from official website and it is missing python27.dll. How can I get this DLL?

like image 280
denfromufa Avatar asked Jul 01 '14 19:07

denfromufa


People also ask

How do I fix python27 dll missing?

Method 1: Download Python27.dll to PC from our site. Copy the file to the program install directory after where it is missing the DLL file. Or move the DLL file to the directory of your System (C:\Windows\System32, and for a 64 bit in C:\Windows\SysWOW64\). Now you need to reboot the computer.

Where is python27 dll?

Actually on 64-bit Windows, the 64-bit dll gets installed to C:\Windows\System32 and not C:\Windows\System .

How to fix python dll not found?

Reinstalling the program may fix this problem. python27. dll is either not designed to run on Windows or it contains an error. Try installing the program again using the original installation media or contact your system administrator or the software vender for support.


2 Answers

At least for the ActiveState Python distribution, and in the official Python distribution:

https://docs.python.org/2/faq/windows.html#id7

The dll is in

C:\Windows\System\PythonNN.dll 

where NN is the version number. On a 64-bit, a 32 bit dll will be installed here:

%SystemRoot%\SysWoW64 

and a running 32 bit application will magically translate this to the proper path, http://en.wikipedia.org/wiki/WoW64

When I link againsy Python27, I use the lib file here:

C:\Python27\libs\python27.lib 

It is somewhat disappointing that the dll gets put in system directories since it means that you can have only one 32 bit and one 64 bit distribution with the same version number.

Update:

Note that if you use the Anaconda or Miniconda Python distributions from Continuum Analytics (http://continuum.io), they are much more portable in the sense they package the dll along with the rest of the files in the installation.

like image 84
Juan Avatar answered Oct 02 '22 16:10

Juan


I deploy Python via source control so can't rely on

C:\Windows\System\PythonNN.dll

To resolve this, I install Python using the msi package and copy the dll into the same directory as the python.exe. I then commit the python folder to source control for our teams to use. Finally, I uninstall Python from my local machine to ensure a clean environment.

I have not noticed an issue with doing this over the past 7 years but would love to learn more about any caveats using this approach.

like image 43
planetboy Avatar answered Oct 02 '22 15:10

planetboy