I am getting the following tracebacks when I try to colcon build my workspace (I am using Ros2 Foxy in windows):
--- stderr: dynamixel_sdk_custom_interfaces
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\yimmi\AppData\Roaming\Python\Python38\site-packages\numpy\__init__.py", line 138, in <module>
from . import _distributor_init
File "C:\Users\yimmi\AppData\Roaming\Python\Python38\site-packages\numpy\_distributor_init.py", line 26, in <module>
WinDLL(os.path.abspath(filename))
File "ctypes\__init__.py", line 373, in __init__
OSError: [WinError 193] %1 no es una aplicaci¾n Win32 vßlida
CMake Error at C:/opt/ros/foxy/x64/share/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake:213 (message):
execute_process(C:/opt/ros/foxy/x64/python.exe -c 'import
numpy;print(numpy.get_include())') returned error code 1
Call Stack (most recent call first):
C:/opt/ros/foxy/x64/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
C:/opt/ros/foxy/x64/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:286 (ament_execute_extensions)
CMakeLists.txt:31 (rosidl_generate_interfaces)
Does anyone know how to solve it?
I notice this:
WinError 193
It looks your python runtime version is not match Numpy (CPU arch different?). Maybe you had installed Anacoda and it overrides the default python path.
You could try to check your python path.
Related
Installing pymqi in a MacOS M1 Pro 12.1 Monterey, Python 3.9.9 in a virtualenv and the usual suspect appeared again:
Traceback (most recent call last):
File "/Users/a.gounaris/.virtualenvs/mxhub39/lib/python3.9/site-packages/pymqi/__init__.py", line 132, in <module>
from . import pymqe # type: ignore
ImportError: dlopen(/Users/a.gounaris/.virtualenvs/mxhub39/lib/python3.9/site-packages/pymqi/pymqe.cpython-39-darwin.so, 0x0002): symbol not found in flat namespace '_MQBACK'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/a.gounaris/.virtualenvs/mxhub39/lib/python3.9/site-packages/pymqi/__init__.py", line 134, in <module>
import pymqe # type: ignore # Backward compatibility
ModuleNotFoundError: No module named 'pymqe'
All paths are in place /opt/mqm/bin:/opt/mqm/samp/bin and Python sees the env variable os.environ['DYLD_LIBRARY_PATH']=='/opt/mqm/lib64'
After reinstalling pymqi with --verbose flag, this warning showed up:
ld: warning: ignoring file /opt/mqm/lib64/libmqic_r.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Might be the root cause of the exception symbol not found in flat namespace '_MQBACK' in M1 Pro Silicon platforms ?
It says that ibmqic_r.dylib is ignored.
Would a new release of MacOS Toolkit build for macOS-arm64 solve the issue?
Another option - theoretically speaking - could be to run the build for macOS-x86_64 with Rosetta 2 as suggested in this post, I don't know how to do it..
Any help will be mostly appreciated.
C:\Users\Raj Kubal>python
Python 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated. Libraries may fail to load. To activate this environment
please see https://conda.io/activation
>>> import tensorflow
Traceback (most recent call last):
File "C:\Users\Raj Kubal\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Raj Kubal\anaconda3\lib\site-packages\tensorflow\__init__.py", line 41, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\Raj Kubal\anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 40, in <module>
from tensorflow.python.eager import context
File "C:\Users\Raj Kubal\anaconda3\lib\site-packages\tensorflow\python\eager\context.py", line 35, in <module>
from tensorflow.python import pywrap_tfe
File "C:\Users\Raj Kubal\anaconda3\lib\site-packages\tensorflow\python\pywrap_tfe.py", line 28, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\Raj Kubal\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\Raj Kubal\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: The specified module could not be found.
Failed to load the native TensorFlow runtime.
I followed the instructions given by the official documents, but stuck in executing ./install.sh.
MacOS version:10.14.5 (18F132)
Python version:python2.7
After I download the zip file given by the gcloud website, I run the command ./install.sh.It told me
weiziyangdeMacBook-Pro:google-cloud-sdk weiziyang$ ./install.sh
Welcome to the Google Cloud SDK!
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
File "/usr/local/Cellar/python#2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/local/Cellar/python#2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
File "/usr/local/Cellar/python#2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/local/Cellar/python#2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
File "/usr/local/Cellar/python#2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/local/Cellar/python#2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
File "/usr/local/Cellar/python#2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/local/Cellar/python#2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
File "/usr/local/Cellar/python#2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/local/Cellar/python#2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
File "/usr/local/Cellar/python#2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/local/Cellar/python#2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512
Traceback (most recent call last):
File "/Users/weiziyang/google-cloud-sdk/bin/bootstrapping/install.py", line 12, in <module>
import bootstrapping
File "/Users/weiziyang/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 32, in <module>
import setup # pylint:disable=g-import-not-at-top
File "/Users/weiziyang/google-cloud-sdk/bin/bootstrapping/setup.py", line 55, in <module>
from googlecloudsdk.core import properties
File "/Users/weiziyang/google-cloud-sdk/lib/googlecloudsdk/core/properties.py", line 27, in <module>
from googlecloudsdk.core import config
File "/Users/weiziyang/google-cloud-sdk/lib/googlecloudsdk/core/config.py", line 29, in <module>
from googlecloudsdk.core.util import files as file_utils
File "/Users/weiziyang/google-cloud-sdk/lib/googlecloudsdk/core/util/files.py", line 600, in <module>
class Checksum(object):
File "/Users/weiziyang/google-cloud-sdk/lib/googlecloudsdk/core/util/files.py", line 603, in Checksum
def __init__(self, algorithm=hashlib.sha256):
AttributeError: 'module' object has no attribute 'sha256'
I checked the module of python2, it provided that I haved installed hashlib correctly and has the attribute 'sha256'
weiziyangdeMacBook-Pro:google-cloud-sdk weiziyang$ python2
Python 2.7.10 (default, Feb 22 2019, 21:55:15)
[GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.37.14)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
>>> hashlib.sha256
<built-in function openssl_sha256>
>>> exit()
I expect it can be installed correctly.
What worked for me was
brew uninstall all openssl and python packages listed by brew list
brew install python3
sudo ln -s /usr/local/bin/python3 /usr/local/bin/python and sudo ln -s /usr/local/bin/pip3 /usr/local/bin/pip
Installing gcloud with the Google Cloud SDK installer
https://cloud.google.com/sdk/docs/downloads-interactive
This is what I've done
Go to /usr/local/Cellar/ and remove all python folder except python#3.x.x then run ./install.sh again and then it will work.
The two Python versions you're using in the two examples above are different. The first Python you use is 2.7.15:
File "/usr/local/Cellar/python#2/2.7.15/...
And the second one is 2.7.10:
Python 2.7.10 (default, Feb 22 2019, 21:55:15)
It looks like your 2.7.15 installation of Python didn't install hashlib correctly (this can happen because of OpenSSL problems during installation, among other things). If I had to guess, the Cloud SDK install.sh script looks for a python executable, and python probably points to the broken 2.7.15 installation, while python2 probably points to the 2.7.10 installation on your system.
The problem is raised by the conflict of libssl.
So, the solution is that:
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
I am trying to compile following trivial code with Cython on Windows7 (64bit) and WinPython:
File testpy.py:
print("hello world from testpy.py file.")
File compile.py
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
ext_modules = [
Extension("testpy", ["testpy.py"]),
# ... all your modules that need be compiled ...
]
setup(
name = 'My Program Name',
cmdclass = {'build_ext': build_ext},
ext_modules = ext_modules
)
I first give command to use mingw:
D:\myfolder> make_cython_use_mingw
cython has been set to use mingw32
to remove this, remove file "E:\WinPython\settings\pydistutils.cfg"
I then give command to compile:
D:\myfolder> python compile.py build_ext --inplace
The process starts but ends with following error:
running build_ext
skipping 'testpy.c' Cython extension (up-to-date)
building 'testpy' extension
C:\MinGW\bin\gcc.exe -mdll -O -Wall -IE:\WinPython\python-3.6.5.amd64\include -IE:\WinPython\python-3.6.5.amd64\include -c testpy.c -o build
\temp.win-amd64-3.6\Release\testpy.o
In file included from E:\WinPython\python-3.6.5.amd64\include/Python.h:68:0,
from testpy.c:4:
E:\WinPython\python-3.6.5.amd64\include/pytime.h:122:12: warning: 'struct timeval' declared inside parameter list will not be visible outsid
e of this definition or declaration
struct timeval *tv,
^~~~~~~
E:\WinPython\python-3.6.5.amd64\include/pytime.h:127:12: warning: 'struct timeval' declared inside parameter list will not be visible outsid
e of this definition or declaration
struct timeval *tv,
^~~~~~~
writing build\temp.win-amd64-3.6\Release\testpy.cp36-win_amd64.def
C:\MinGW\bin\gcc.exe -shared -s build\temp.win-amd64-3.6\Release\testpy.o build\temp.win-amd64-3.6\Release\testpy.cp36-win_amd64.def -LE:\Wi
nPython\python-3.6.5.amd64\libs -LE:\WinPython\python-3.6.5.amd64\PCbuild\amd64 -lpython36 -o D:\myfolder\testpy.cp36-win_amd64.pyd
Cannot export PyInit_testpy: symbol not defined
collect2.exe: error: ld returned 1 exit status
error: command 'C:\\MinGW\\bin\\gcc.exe' failed with exit status 1
Where is the problem and how can it be solved?
Edit:
On renaming py file as pyx as suggested by #ead in comments, it worked to create pyd file. However, on trying it gives following error:
D:\Myfolder>python -c "import Testpy"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: DLL load failed: %1 is not a valid Win32 application.
Why is this not a valid Win32 application?
My python version is as follows:
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)] on win32
Edit: I found that I had mingw installed separately also (apart from part of winpython). I removed that and tried again. I am now getting following error:
python compile.py build_ext --inplace
Traceback (most recent call last):
File "compile.py", line 12, in <module>
ext_modules = ext_modules
File "E:\WinPython\python-3.6.5.amd64\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "E:\WinPython\python-3.6.5.amd64\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "E:\WinPython\python-3.6.5.amd64\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "E:\WinPython\python-3.6.5.amd64\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "E:\WinPython\python-3.6.5.amd64\lib\distutils\command\build_ext.py", line 308, in run
force=self.force)
File "E:\WinPython\python-3.6.5.amd64\lib\distutils\ccompiler.py", line 1031, in new_compiler
return klass(None, dry_run, force)
File "E:\WinPython\python-3.6.5.amd64\lib\distutils\cygwinccompiler.py", line 282, in __init__
CygwinCCompiler.__init__ (self, verbose, dry_run, force)
File "E:\WinPython\python-3.6.5.amd64\lib\distutils\cygwinccompiler.py", line 126, in __init__
if self.ld_version >= "2.10.90":
TypeError: '>=' not supported between instances of 'NoneType' and 'str'
How can this be corrected?
I installed tensorflow on windows with anaconda following the tutorial in the official website.
But when I'm trying to import tensorflow on python, I have this error :
(tensorflow1) C:\Users\bromy>python
Python 3.5.4 |Anaconda, Inc.| (default, Nov 8 2017, 14:34:30) [MSC v.1900
64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Traceback (most recent call last):
File "C:\Users\bromy\AppData\Local\conda\conda\envs\tensorflow1\lib\site-
packages\tensorflow\python\platform\self_check.py", line 75, in preload_check
ctypes.WinDLL(build_info.cudart_dll_name)
File "C:\Users\bromy\AppData\Local\conda\conda\envs\tensorflow1\lib\ctypes\__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] Le module spécifié est introuvable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\bromy\AppData\Local\conda\conda\envs\tensorflow1\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import *
File "C:\Users\bromy\AppData\Local\conda\conda\envs\tensorflow1\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\bromy\AppData\Local\conda\conda\envs\tensorflow1\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 30, in <module>
self_check.preload_check()
File "C:\Users\bromy\AppData\Local\conda\conda\envs\tensorflow1\lib\site-packages\tensorflow\python\platform\self_check.py", line 82, in preload_check
% (build_info.cudart_dll_name, build_info.cuda_version_number))
ImportError: Could not find 'cudart64_80.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Download and install CUDA 8.0 from this URL: https://developer.nvidia.com/cuda-toolkit
I installed CUDA 8.0 but it didn't change anything
Do you have any ideas ?
Thank you