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.
Related
could somebody help me with this?
I just simple follow the instruction of megvii
python setup.py develop
the problem comeup:
(newtorch) PS D:\codeofpaper\YOLOX-main> python setup.py develop
running develop
running egg_info
writing yolox.egg-info\PKG-INFO
writing dependency_links to yolox.egg-info\dependency_links.txt
writing top-level names to yolox.egg-info\top_level.txt
reading manifest file 'yolox.egg-info\SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'yolox.egg-info\SOURCES.txt'
running build_ext
Traceback (most recent call last):
File "setup.py", line 63, in <module>
packages=setuptools.find_packages(),
File "D:\Anaconda\Anaconda3\envs\newtorch\lib\site-packages\setuptools\__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "D:\Anaconda\Anaconda3\envs\newtorch\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "D:\Anaconda\Anaconda3\envs\newtorch\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "D:\Anaconda\Anaconda3\envs\newtorch\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\Anaconda\Anaconda3\envs\newtorch\lib\site-packages\setuptools\command\develop.py", line 34, in run
self.install_for_development()
File "D:\Anaconda\Anaconda3\envs\newtorch\lib\site-packages\setuptools\command\develop.py", line 114, in install_for_development
self.run_command('build_ext')
File "D:\Anaconda\Anaconda3\envs\newtorch\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\Anaconda\Anaconda3\envs\newtorch\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\Anaconda\Anaconda3\envs\newtorch\lib\site-packages\setuptools\command\build_ext.py", line 79, in run
_build_ext.run(self)
File "D:\Anaconda\Anaconda3\envs\newtorch\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "D:\Anaconda\Anaconda3\envs\newtorch\lib\distutils\command\build_ext.py", line 309, in run
force=self.force)
File "D:\Anaconda\Anaconda3\envs\newtorch\lib\distutils\ccompiler.py", line 1032, in new_compiler
return klass(None, dry_run, force)
File "D:\Anaconda\Anaconda3\envs\newtorch\lib\distutils\cygwinccompiler.py", line 285, in __init__
CygwinCCompiler.__init__ (self, verbose, dry_run, force)
File "D:\Anaconda\Anaconda3\envs\newtorch\lib\distutils\cygwinccompiler.py", line 129, in __init__
if self.ld_version >= "2.10.90":
TypeError: '>=' not supported between instances of 'NoneType' and 'str'
MY CMDline output
I don't kbow what to do?
My cp is Windows10,and I use anaconda virtual env
This means that gcc was not found on your computer, i.e. cygwin is not set up correctly. distutils tries to find the version with this line:
commands = ['gcc -dumpversion', 'ld -v', 'dllwrap --version']
return tuple([_find_exe_version(cmd) for cmd in commands])
So make sure that your PATH is set up correctly so that you can run these commands from the same terminal from which you executed your pip install
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 ?
I am trying to install rpy2-2.3.1 on Windows 7, using the source files under rpy2-2.3.1.tar.gz.
However, upon running setup.py on the command prompt, I get the trace-back below. I have checked a few stack-overflow posts on installing RPy2 on windows 7 and am already aware that it is a challenge. Does anyone have an idea what went wrong in my case?
Thanks in advance.
P.S: I cannot install it using the .exe since I get the 'Python version 2.7. required, which was not found in the registry' warning and do not have privileges to update the registry. So it is not an option for me.
P.S2: Before I started getting this trace-back I set up the R path as: C:\Program Files\R\R-3.01\bin. This I believe points to a 64-bit R. May this be causing the problem?
I:\Documents\Visual Studio 2010\Projects\MyProject\rpy2-2.3.1>C:/Python27/python.exe setup.py install
running install
running build
running build_py
running build_ext
Traceback (most recent call last):
File "setup.py", line 463, in <module>
'rpy2': ['doc/source/rpy2_logo.png', ]}
File "C:\u\windows\Python27\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\u\windows\Python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\u\windows\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\u\windows\Python27\lib\distutils\command\install.py", line 563, in run
self.run_command('build')
File "C:\u\windows\Python27\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\u\windows\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\u\windows\Python27\lib\distutils\command\build.py", line 127, in run
self.run_command(cmd_name)
File "C:\u\windows\Python27\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\u\windows\Python27\lib\distutils\dist.py", line 971, in run_command
cmd_obj.ensure_finalized()
File "C:\u\windows\Python27\lib\distutils\cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "setup.py", line 163, in finalize_options
config += get_rconfig(r_home, about)
File "setup.py", line 333, in get_rconfig
rc = RConfig.from_string(rconfig, allow_empty = allow_empty)
File "setup.py", line 293, in from_string
+ '\nin string\n' + string)
ValueError: Invalid substring
in string
This site has what you are looking for. It has a lot of good modules in .exe format:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#rpy2
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.
I happened to stumble upon an answer posted by user brentlance regarding the linking of Matlab to Python, and was wondering if I could ask the community for some advice regarding the initial setup of the mlabwrap module.
I'm on Windows 7 32 bit, using Matlab R2012a and Python 2.7 (from the Python(x,y) scientific computing package). When I try to run:
python setup.py install
in the malbwrap directory, the console returns a very large error, as presented:
WINDOWS SPECIFIC ISSUE? Unable to remove c:\users\nathan\appdata\local\temp\tmpv
tzipc; please delete it manually
[Error 32] The process cannot access the file because it is being used by anothe
r process: 'c:\\users\\nathan\\appdata\\local\\temp\\tmpvtzipc'
running install
running build
running build_py
running build_ext
building 'mlabraw' extension
Traceback (most recent call last):
File "setup.py", line 189, in <module>
extra_compile_args=EXTRA_COMPILE_ARGS,
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 972, in run_command
cmd_obj.run()
File "C:\Python27\lib\distutils\command\build_ext.py", line 340, in run
self.build_extensions()
File "C:\Python27\lib\distutils\command\build_ext.py", line 449, in build_exte
nsions
self.build_extension(ext)
File "C:\Python27\lib\distutils\command\build_ext.py", line 499, in build_exte
nsion
depends=ext.depends)
File "C:\Python27\lib\distutils\msvc9compiler.py", line 474, in compile
self.initialize()
File "C:\Python27\lib\distutils\msvc9compiler.py", line 384, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\Python27\lib\distutils\msvc9compiler.py", line 300, in query_vcvarsal
l
raise ValueError(str(list(result.keys())))
ValueError: [u'path']
In response to various other issues, I've thus far tried the following:
I followed the installation guide posted here
Installed Microsoft VS Express 2010 and SDK version 7.1
Set the SDK C++ compiler to the default in Matlab
Pointed the msvc9compiler.py script (C:\Python27\Lib\distutils\msvc9compiler.py) at the Common Tools folder for my VS Express install in order to avoid an 'unable to locate vcvarsall.bat' error, as described here.
Any help you guys could provide would be greatly appreciated. Many thanks.