Compiling Python 2.7 installer on Windows - python

I'm trying to compile Python 2.7 installer on Windows. The compilation works fine, but when I try to run
PCbuild\python.exe setup.py bdist_wininst
I get an error:
error: pyconfig.h: No such file or directory
How can I fix that?
Update:
I found a file called Pyconfig.h.in in the root directory. After renaimnig it to Pyconfig.h bdist fails with the following error:
Traceback (most recent call last):
File "setup.py", line 2076, in <module>
main()
File "setup.py", line 2071, in main
'Lib/smtpd.py']
File "Python-2.7.3\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "Python-2.7.3\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "Python-2.7.3\Python-2.7.3\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "Python-2.7.3\lib\distutils\command\bdist_wininst.py", line 131, in run
self.run_command('build')
File "Python-2.7.3\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "Python-2.7.3\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "Python-2.7.3\lib\distutils\command\build.py", line 127, in run
self.run_command(cmd_name)
File "Python-2.7.3\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "Python-2.7.3\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "Python-2.7.3\lib\distutils\command\build_ext.py", line 339, in run
self.build_extensions()
File "setup.py", line 152, in build_extensions
missing = self.detect_modules()
File "setup.py", line 1146, in detect_modules
for arg in sysconfig.get_config_var("CONFIG_ARGS").split()]
AttributeError: 'NoneType' object has no attribute 'split'
Thanks in advance, Ivan.

Related

Installing numpy in PyCharm on windows 10

I'm using Python 3.8 and I'm trying to install numpy on PyCharm 2019.2 but I keep having this error.
I have been told that there are problems in pythons 3.8 and that is why I can't install numpy.
LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
failure.
removing: _configtest.c _configtest.obj _configtest.obj.d
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\hp\AppData\Local\Temp\pycharm-packaging\numpy\setup.py", line 444, in <module>
setup_package()
File "C:\Users\hp\AppData\Local\Temp\pycharm-packaging\numpy\setup.py", line 436, in setup_package
setup(**metadata)
File "C:\Users\hp\AppData\Local\Temp\pycharm-packaging\numpy\numpy\distutils\core.py", line 171, in setup
return old_setup(**new_attr)
File "C:\Users\hp\PycharmProjects\untitled\venv\lib\site-packages\setuptools-40.8.0-py3.8.egg\setuptools\__init__.py", line 145, in setup
File "C:\Users\hp\AppData\Local\Programs\Python\Python38-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\hp\AppData\Local\Programs\Python\Python38-32\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\hp\AppData\Local\Programs\Python\Python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\hp\AppData\Local\Temp\pycharm-packaging\numpy\numpy\distutils\command\install.py", line 62, in run
r = self.setuptools_run()
File "C:\Users\hp\AppData\Local\Temp\pycharm-packaging\numpy\numpy\distutils\command\install.py", line 36, in setuptools_run
return distutils_install.run(self)
File "C:\Users\hp\AppData\Local\Programs\Python\Python38-32\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Users\hp\AppData\Local\Programs\Python\Python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\hp\AppData\Local\Programs\Python\Python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\hp\AppData\Local\Temp\pycharm-packaging\numpy\numpy\distutils\command\build.py", line 47, in run
old_build.run(self)
File "C:\Users\hp\AppData\Local\Programs\Python\Python38-32\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\hp\AppData\Local\Programs\Python\Python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\hp\AppData\Local\Programs\Python\Python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\hp\AppData\Local\Temp\pycharm-packaging\numpy\numpy\distutils\command\build_src.py", line 142, in run
self.build_sources()
File "C:\Users\hp\AppData\Local\Temp\pycharm-packaging\numpy\numpy\distutils\command\build_src.py", line 153, in build_sources
self.build_library_sources(*libname_info)
File "C:\Users\hp\AppData\Local\Temp\pycharm-packaging\numpy\numpy\distutils\command\build_src.py", line 286, in build_library_sources
sources = self.generate_sources(sources, (lib_name, build_info))
File "C:\Users\hp\AppData\Local\Temp\pycharm-packaging\numpy\numpy\distutils\command\build_src.py", line 369, in generate_sources
source = func(extension, build_dir)
File "numpy\core\setup.py", line 669, in get_mathlib_info
raise RuntimeError("Broken toolchain: cannot link a simple C program")
RuntimeError: Broken toolchain: cannot link a simple C program
Create a new project and virtual environment in PyCharm. Then try downgrading your python to 3.7.2 and uninstall then reinstall numpy through the project settings in pycharm. In your python or bash terminal run,
conda install python == 3.7.2
If you don't have Anaconda Distribution downloaded then navigate to the "Project Interpreter" in PyCharm and you can install/uninstall libraries directly from there with the plus and minus icon. I think you may have a underlying system problem so going for a fresh install of the dependencies you are having issues with should remedy the problem along with stepping away from version 3.8 of Python.

How can I solve the import error for the module util while running cx_Freeze?

I have Python version 2.7, cx_freeze version 5.0 and Ubuntu 16.04.
On running the command python2 setup.py buildin the requisite directory, I am getting the following error:
running build
running build_exe
Traceback (most recent call last):
File "setup.py", line 39, in <module>
executables = executables
File "/usr/lib/python2.7/dist-packages/cx_Freeze/dist.py", line 349, in setup
distutils.core.setup(**attrs)
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run
self.run_command(cmd_name)
File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/dist-packages/cx_Freeze/dist.py", line 219, in run
freezer.Freeze()
File "/usr/lib/python2.7/dist-packages/cx_Freeze/freezer.py", line 618, in Freeze
import cx_Freeze.util
ImportError: No module named util
cx_freeze has its source code here and here. I thought of downloading the util file to the cx_freeze folder on my local machine but neither did I get it nor am I sure of the validness of this method.
So, how do I solve this issue ?

Error Installing Tornado 4.0 Windows7 64bit

Help,
Am trying to install tornado 4.0 on my windows7 64bit but am getting the following error;
building 'tornado.speedups' extension
Traceback (most recent call last):
File "setup.py", line 176, in <module>
**kwargs
File "c:\Python27\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "c:\Python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "c:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "c:\Python27\lib\site-packages\setuptools\command\install.py", line 67, in run
self.do_egg_install()
File "c:\Python27\lib\site-packages\setuptools\command\install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "c:\Python27\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "c:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "c:\Python27\lib\site-packages\setuptools\command\bdist_egg.py", line 161, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "c:\Python27\lib\site-packages\setuptools\command\bdist_egg.py", line 147, in call_command
self.run_command(cmdname)
File "c:\Python27\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "c:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "c:\Python27\lib\site-packages\setuptools\command\install_lib.py", line 9, in run
self.build()
File "c:\Python27\lib\distutils\command\install_lib.py", line 111, in build
self.run_command('build_ext')
File "c:\Python27\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "c:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "setup.py", line 85, in run
build_ext.run(self)
File "c:\Python27\lib\distutils\command\build_ext.py", line 337, in run
self.build_extensions()
File "c:\Python27\lib\distutils\command\build_ext.py", line 446, in build_extensions
self.build_extension(ext)
File "setup.py", line 97, in build_extension
build_ext.build_extension(self, ext)
File "c:\Python27\lib\distutils\command\build_ext.py", line 496, in build_extension
depends=ext.depends)
File "c:\Python27\lib\distutils\msvc9compiler.py", line 473, in compile
self.initialize()
File "c:\Python27\lib\distutils\msvc9compiler.py", line 383, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "c:\Python27\lib\distutils\msvc9compiler.py", line 299, in query_vcvarsall
raise ValueError(str(list(result.keys())))
ValueError: [u'path']
Any ideas what am missing
Paul
This looks like https://github.com/tornadoweb/tornado/issues/1115 which was reportedly due to a mismatch of 64-bit python and 32-bit visual c++. The next release of Tornado (after 4.0) will skip the extension module and fall back to pure-python mode in this case.

How to install FLANN and pyflann on Windows

How can I setup FLANN on Python (pyflann) on Windows? I know FLANN is now in openCV but I need the standalone version. The instructions here suggest compiling the FLANN binary or downloading a version from PointClouds but I can't use any of these.
I compiled from source but after I tried to run setup.py I got this error:
>
C:\Python27\flann-1.8.4-src\src\python>python setup.py install
running install
running build
running build_py
Traceback (most recent call last):
File "setup.py", line 27, in <module>
package_data={'pyflann.lib': ['libflann.so', 'flann.dll', 'libflann.dll', 'libflann.dylib']},
File "C:\Python27\lib\distutils\core.py", line 152, in setup dist.run_commands()
File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands self.run_command(cmd)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command cmd_obj.run()
File "C:\Python27\lib\distutils\command\install.py", line 563, in run self.run_command('build')
File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command self.distribution.run_command(command)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command cmd_obj.run()
File "C:\Python27\lib\distutils\command\build.py", line 127, in run self.run_command(cmd_name)
File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command self.distribution.run_command(command)
File "C:\Python27\lib\distutils\dist.py", line 971, in run_command cmd_obj.ensure_finalized()
File "C:\Python27\lib\distutils\cmd.py", line 109, in ensure_finalized self.finalize_options()
File "C:\Python27\lib\distutils\command\build_py.py", line 57, in finalize_options self.data_files = self.get_data_files()
File "C:\Python27\lib\distutils\command\build_py.py", line 117, in get_data_files file[plen:] for file in self.find_data_files(package, src_dir)
File "C:\Python27\lib\distutils\command\build_py.py", line 129, in find_data_files filelist = glob(os.path.join(src_dir, convert_path(pattern)))
File "C:\Python27\lib\ntpath.py", line 96, in join assert len(path) > 0
TypeError: object of type 'NoneType' has no len()
Could anyone help me to solve this or direct me to another version of flann which can I simply install?
Extract the zipped archive to C:\flann-1.8.4-src\.
Open a cmd window as Administrator (right click > Run as Administrator)
Then do the following:
cd C:\flann-1.8.4-src\
mkdir build
cd build
cmake .. -G "NMake Makefiles"
nmake install
The nmake install line should get pyflann installed without needing to call setup.py separately.

Is there 64-bit version pymongo?

When i install pymongo using easy_install with 64-bit python, exception happens. But it works with 32-bit python. It seems only 32-bit python is supported.
So i want to know whether 64-bit pymongo exists?
Thanks.
--- more details ---
running install
running bdist_egg
running egg_info
writing pymongo.egg-info\PKG-INFO
writing top-level names to pymongo.egg-info\top_level.txt
writing dependency_links to pymongo.egg-info\dependency_links.txt
reading manifest file 'pymongo.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.h' under directory 'pymongo'
writing manifest file 'pymongo.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
building 'bson._cbson' extension
Traceback (most recent call last):
File "F:\mongodb-mongo-python-driver-7269ec4\setup.py", line 184, in <module>
"doc": doc})
File "C:\Python26\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Python26\lib\distutils\dist.py", line 975, in run_commands
self.run_command(cmd)
File "C:\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "build\bdist.win-amd64\egg\setuptools\command\install.py", line 76, in ru
n
File "build\bdist.win-amd64\egg\setuptools\command\install.py", line 96, in do
_egg_install
File "C:\Python26\lib\distutils\cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "C:\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "build\bdist.win-amd64\egg\setuptools\command\bdist_egg.py", line 175, in
run
File "build\bdist.win-amd64\egg\setuptools\command\bdist_egg.py", line 161, in
call_command
File "C:\Python26\lib\distutils\cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "C:\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "build\bdist.win-amd64\egg\setuptools\command\install_lib.py", line 20, i
n run
File "C:\Python26\lib\distutils\command\install_lib.py", line 112, in build
self.run_command('build_ext')
File "C:\Python26\lib\distutils\cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "C:\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "F:\mongodb-mongo-python-driver-7269ec4\setup.py", line 108, in run
build_ext.run(self)
File "C:\Python26\lib\distutils\command\build_ext.py", line 345, in run
self.build_extensions()
File "C:\Python26\lib\distutils\command\build_ext.py", line 471, in build_exte
nsions
self.build_extension(ext)
File "F:\mongodb-mongo-python-driver-7269ec4\setup.py", line 118, in build_ext
ension
build_ext.build_extension(self, ext)
File "C:\Python26\lib\distutils\command\build_ext.py", line 536, in build_exte
nsion
depends=ext.depends)
File "C:\Python26\lib\distutils\msvc9compiler.py", line 448, in compile
self.initialize()
File "C:\Python26\lib\distutils\msvc9compiler.py", line 358, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\Python26\lib\distutils\msvc9compiler.py", line 274, in query_vcvarsal
l
raise ValueError(str(list(result.keys())))
ValueError: [u'path']
Run vcvarsall.bat first, then install pymongo.

Categories

Resources