I'm trying to run some faster r cnn tf code that I got from GitHub. All those code need to run 'make' command to run the Cython (correct me if I am wrong). But everytime I run the make command I always got the same problem for every code.
I'm using windows 10 professional with python 3.5
My tensorflow version is 1.8.0 with gpu and CUDA 9.0
here is the error from the command line :
python setup.py build_ext --inplace
running build_ext
Traceback (most recent call last):
File "setup.py", line 150, in <module>
cmdclass={'build_ext': custom_build_ext},
File "C:\Users\USER\AppData\Local\Programs\Python\Python35\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\USER\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Users\USER\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\USER\AppData\Local\Programs\Python\Python35\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "C:\Users\USER\AppData\Local\Programs\Python\Python35\lib\distutils\command\build_ext.py", line 338, in run
self.build_extensions()
File "setup.py", line 104, in build_extensions
customize_compiler_for_nvcc(self.compiler)
File "setup.py", line 77, in customize_compiler_for_nvcc
default_compiler_so = self.compiler_so
AttributeError: 'MSVCCompiler' object has no attribute 'compiler_so'
make: *** [all] Error 1
The .compiler_so field is only present in distutils.unixcompiler.UnixCCompiler and derivatives.
So, this package does not support standard Windows build environment.
As per Build from source on Windows | TensorFlow, it's supposed to be built using MSYS2.
Related
I'm attempting to use Py2exe to create a Python executable out of my program. The program definitely works and I've made sure all the libraries it uses are up to date, but when I attempt to run the command "python setup.py py2exe" to finish it up, I get an error I'm unfamiliar with.
The full output is below:
running py2exe
C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\distutils_patch.py:25: UserWarning: Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable behaviors or errors. Please use Setuptools' objects directly or at least import Setuptools first.
warnings.warn(
Traceback (most recent call last):
File "C:\Users\user\OneDrive\Desktop\intern\pdf\setup.py", line 11, in
setup(console=[{ "script": "tca_script.py"}],
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\py2exe\distutils_buildexe.py", line 192, in run
self._run()
File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\py2exe\distutils_buildexe.py", line 272, in _run
builder.analyze()
File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\py2exe\runtime.py", line 172, in analyze
mf.import_package(modname)
File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\py2exe\mf34.py", line 84, in import_package
self.import_package("%s.%s" % (name, modname))
File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\py2exe\mf34.py", line 84, in import_package
self.import_package("%s.%s" % (name, modname))
File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\py2exe\mf34.py", line 84, in import_package
self.import_package("%s.%s" % (name, modname))
File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\py2exe\mf34.py", line 71, in import_package
package = self.modules[name]
KeyError: 'pandas.tests.io.excel'
Any help would be greatly appreciated.
I installed cygwin with python, make and diffutils.
When I am using the command:
./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-mpich --download-fblaslapack
I am getting an error "Windows Python Detected. Please rerun ./configure with cygwin-python".
If I use the command at the cygwin commandline
python setup.py install
I am getting the following runtime error:
Traceback (most recent call last):
File "setup.py", line 314, in <module>
**metadata)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\__init__.py", line 143, in setup
return distutils.core.setup(**attrs)
File "C:\ProgramData\Anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "setup.py", line 230, in run
config(prefix, self.dry_run)
File "setup.py", line 166, in config
if status != 0: raise RuntimeError(status)
RuntimeError: 3
Any help welcome.
If you are building on Cygwin do NOT mix with Windows version of Python
so sanitize your PATH to have only cygwin program in it:
export PATH="/usr/local/bin:/usr/bin:/usr/lib/lapack"
./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran
about this two settings
--download-mpich --download-fblaslapack
cygwin has its own OpenMPI, Blas and Lapack packages,
so you should use them.
The package names are:
$ cygcheck -cd |grep openmpi
libopenmpi-devel 3.1.6-1
libopenmpi40 3.1.6-1
libopenmpifh40 3.1.6-1
libopenmpiusef08_40 3.1.6-1
libopenmpiusetkr40 3.1.6-1
openmpi 3.1.6-1
$ cygcheck -cd |grep "lapack\|openblas"
liblapack-devel 3.9.0-2
liblapack0 3.9.0-2
libopenblas 0.3.9-1
I am not sure but MPICH, but it will very likely NOT build under Cygwin
When I installed PyAuduo for my MIPS embedded platform, I got this error:
running build
Traceback (most recent call last):
File "setup.py", line 122, in <module>
extra_link_args=extra_link_args)
File "/usr/local/lib/python3.5/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/local/lib/python3.5/distutils/dist.py", line 955, in
run_commands
self.run_command(cmd)
File "/usr/local/lib/python3.5/distutils/dist.py", line 973, in
run_command
cmd_obj.ensure_finalized()
File "/usr/local/lib/python3.5/distutils/cmd.py", line 107, in
ensure_finalized
self.finalize_options()
File "/usr/local/lib/python3.5/site-packages/distutilscross-0.1-
py3.5.egg/distutilscross/crosscompile.py", line 16, in finalize_options
AttributeError: '_Environ' object has no attribute 'has_key'
It seems "crosscompile.py" cannot run python3 normally.
Does anyone have idea how to modify the code in crosscompile.py to work normally in pyhton3?
how to solve AttributeError: '_Environ' object has no attribute 'has_key'
It seems like PyAudio was built in Python 2x. Python 2x had support for has_key() function to check if keys existed in dictionaries. In Python 3x, you simply do this:
if 'the_key' in os.environ:
You can potentially change this line in crosscompile.py as a quickfix and then contact the developer (http://people.csail.mit.edu/hubert/pyaudio/#contact).
I am trying to use pypy. My python scripts are using numpy. So when I used pypy 1.9.0 it showed me this:
"The 'numpy' module of PyPy is in-development and not complete. "
ImportError: The '`numpy' module` of PyPy is in-development and not complete. To try it out anyway, you can either import from 'numpypy', or just write 'import numpypy' first in your program and then import from 'numpy' as usual.
So I used import numpypy and then ran my script. I got this error:
File "customecode.py", line 97, in dist_new
dlat = radians(p2[..., 0] - p1[..., 0])
TypeError: expected integer, got Ellipsis object
I couldn't find anything on this kind of error. Although script is running fine when I use python. So my guess is that may be pypy still don't support everything which is there on numpy.
I found this link on pypy-numpy update. So I install pypy 2.2.1
http://morepypy.blogspot.in/2013/11/numpy-status-update.html
In this link following instructions are given for installing numpy for pypy:
git clone https://bitbucket.org/pypy/numpy.git
cd numpy
pypy setup.py install
after running pypy setup.py installI got this type error:
Traceback (most recent call last):
File "app_main.py", line 51, in run_toplevel
File "setup.py", line 239, in <module>
setup_package()
File "setup.py", line 231, in setup_package
setup(**metadata)
File "/home/administrator/numpy/numpy/distutils/core.py", line 169, in setup
return old_setup(**new_attr)
File "/usr/lib/pypy/lib-python/2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib/pypy/lib-python/2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/pypy/lib-python/2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/home/administrator/numpy/numpy/distutils/command/install.py", line 57, in run
r = old_install.run(self)
File "/usr/lib/pypy/lib-python/2.7/distutils/command/install.py", line 613, in run
self.run_command('build')
File "/usr/lib/pypy/lib-python/2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib/pypy/lib-python/2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/home/administrator/numpy/numpy/distutils/command/build.py", line 39, in run
old_build.run(self)
File "/usr/lib/pypy/lib-python/2.7/distutils/command/build.py", line 127, in run
self.run_command(cmd_name)
File "/usr/lib/pypy/lib-python/2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib/pypy/lib-python/2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/home/administrator/numpy/numpy/distutils/command/build_src.py", line 153, in run
self.build_sources()
File "/home/administrator/numpy/numpy/distutils/command/build_src.py", line 164, in build_sources
self.build_library_sources(*libname_info)
File "/home/administrator/numpy/numpy/distutils/command/build_src.py", line 299, in build_library_sources
sources = self.generate_sources(sources, (lib_name, build_info))
File "/home/administrator/numpy/numpy/distutils/command/build_src.py", line 386, in generate_sources
source = func(extension, build_dir)
File "numpy/core/setup.py", line 678, in get_mathlib_info
st = config_cmd.try_link('int main(void) { return 0;}')
File "/usr/lib/pypy/lib-python/2.7/distutils/command/config.py", line 248, in try_link
self._check_compiler()
File "/home/administrator/numpy/numpy/distutils/command/config.py", line 46, in _check_compiler
old_config._check_compiler(self)
File "/usr/lib/pypy/lib-python/2.7/distutils/command/config.py", line 103, in _check_compiler
customize_compiler(self.compiler)
File "/usr/lib/pypy/lib-python/2.7/distutils/ccompiler.py", line 44, in customize_compiler
cpp = cc + " -E" # not always
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
I want to use pypy 2.2.1 with whatever development of numpy provided there. Any help with the installation of numpy for pypy is appreciated.
In PyPy 2.2.1, the file lib-python/2.7/distutils/ccompiler.py does not contain any function called customize_compiler() and line 44 is not like that. My guess is that your version of PyPy's standard library has been tweaked by your Linux distribution in a way that makes it crash in your particular case.
I can only suggest that you try to get the "official" PyPy 2.2.1 and compare the results.
I'm trying to build an application with py2app using a virtual python environment. I have python 2.7.3. I can build the app fine using python 2.6 (which I have py2app on), but not with my 2.7.3 virtualenv (because I can't install py2app in my 2.7.3 system-wide installation).
This is the error I get:
running py2app
creating /Users/student/Desktop/Coding Projects/MCManager/build/bdist.macosx-10.6-intel/python2.7-standalone/app
creating /Users/student/Desktop/Coding Projects/MCManager/build/bdist.macosx-10.6-intel/python2.7-standalone/app/collect
creating /Users/student/Desktop/Coding Projects/MCManager/build/bdist.macosx-10.6-intel/python2.7-standalone/app/temp
creating build/bdist.macosx-10.6-intel/python2.7-standalone/app/lib-dynload
creating build/bdist.macosx-10.6-intel/python2.7-standalone/app/Frameworks
Traceback (most recent call last):
File "AppSpec.py", line 21, in <module>
app = ['ScriptUnix.py']
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/Users/student/Desktop/VE/MyVirtEnv/lib/python2.7/site-packages/py2app/build_app.py", line 520, in run
self._run()
File "/Users/student/Desktop/VE/MyVirtEnv/lib/python2.7/site-packages/py2app/build_app.py", line 708, in _run
self.run_normal()
File "/Users/student/Desktop/VE/MyVirtEnv/lib/python2.7/site-packages/py2app/build_app.py", line 779, in run_normal
mf = self.get_modulefinder()
File "/Users/student/Desktop/VE/MyVirtEnv/lib/python2.7/site-packages/py2app/build_app.py", line 658, in get_modulefinder
debug=debug,
File "/Users/student/Desktop/VE/MyVirtEnv/lib/python2.7/site-packages/modulegraph/find_modules.py", line 271, in find_modules
find_needed_modules(mf, scripts, includes, packages)
File "/Users/student/Desktop/VE/MyVirtEnv/lib/python2.7/site-packages/modulegraph/find_modules.py", line 196, in find_needed_modules
path = m.packagepath[0]
TypeError: 'NoneType' object has no attribute '__getitem__'
I'm in the directory of the py2app setup file, running it with ~/Desktop/VE/MyVirtEnv/bin/python AppSpec.py py2app. If I run the same thing with python26 AppSpec.py py2app, it works fine.