Not being able to use turicreate - python

I am trying to use turicreate. I installed it on my device (sudo python2.7 -m pip install turicreate) And when I ran my code (in terminal on Mac), I got a long error message. I believe that the significant part is as follows:
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/turicreate/cython/cy_unity.so, 2): Symbol not found: _syslog$DARWIN_EXTSN
Here is the integrity of it for reference:
Traceback (most recent call last):
File "classifier.py", line 1, in <module>
import turicreate as turi
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/turicreate/__init__.py", line 30, in <module>
from turicreate.data_structures.sgraph import Vertex, Edge
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/turicreate/data_structures/__init__.py", line 18, in <module>
from . import sframe
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/turicreate/data_structures/sframe.py", line 16, in <module>
from ..connect import main as glconnect
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/turicreate/connect/main.py", line 13, in <module>
from ..cython.cy_unity import UnityGlobalProxy
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/turicreate/cython/cy_unity.so, 2): Symbol not found: _syslog$DARWIN_EXTSN
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/turicreate/cython/../libunity_shared.dylib (which was built for Mac OS X 10.13)
Expected in: /usr/lib/libSystem.B.dylib
in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/turicreate/cython/../libunity_shared.dylib
What is the problem here?

This article provides a detailed explanation of setting up Python environment for popular ML packages on Mac - Machine Learning Compass

Related

Import error (tensorflow) after installing tensorflow-macos and other packages (numpy,pandas,tensorflow)

Hi I am trying to use tensorflow on my Mac (M1) and have installed tensorflow-macos with other dependencies in a conda environment I created. However,when i tried to import tensorflow it gave me an error:
>>> import tensorflow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/ambroseling/Desktop/TensorFlow/mlprojs/lib/python3.9/site-packages/tensorflow/__init__.py", line 449, in <module>
_ll.load_library(_plugin_dir)
File "/Users/ambroseling/Desktop/TensorFlow/mlprojs/lib/python3.9/site-packages/tensorflow/python/framework/load_library.py", line 155, in load_library
py_tf.TF_LoadLibrary(lib)
tensorflow.python.framework.errors_impl.NotFoundError: dlopen(/Users/ambroseling/Desktop/TensorFlow/mlprojs/lib/python3.9/site-packages/tensorflow-plugins/libmetal_plugin.dylib, 6): Symbol not found: _OBJC_CLASS_$_MPSGraphCompilationDescriptor
Referenced from: /Users/ambroseling/Desktop/TensorFlow/mlprojs/lib/python3.9/site-packages/tensorflow-plugins/libmetal_plugin.dylib (which was built for Mac OS X 12.0)
Expected in: /System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Versions/A/MetalPerformanceShadersGraph
I basically followed this step by step guide,https://github.com/mrdbourke/m1-machine-learning-test
What might be the cause to the import error? I would greatly appreciate any help on this. Thank you.

why can't I import cupy-cuda101 correctly?

I'm running into issues with importing CuPy after pip installing cupy-cuda101. I've ensured that I'm using the correct CUDA version available and that I only have one version of CuPy installed.
The error code are like follows:
import cupy
Traceback (most recent call last):
File "/home1/xuchenhao/.local/lib/python3.7/site-packages/cupy/__init__.py", line 16, in <module>
from cupy import _core # NOQA
File "/home1/xuchenhao/.local/lib/python3.7/site-packages/cupy/_core/__init__.py", line 1, in <module>
from cupy._core import core # NOQA
File "cupy/_core/core.pyx", line 1, in init cupy._core.core
File "/home1/xuchenhao/.local/lib/python3.7/site-packages/cupy/cuda/__init__.py", line 8, in <module>
from cupy.cuda import compiler # NOQA
File "/home1/xuchenhao/.local/lib/python3.7/site-packages/cupy/cuda/compiler.py", line 11, in <module>
from cupy.cuda import device
File "cupy/cuda/device.pyx", line 10, in init cupy.cuda.device
ImportError: /home1/xuchenhao/.local/lib/python3.7/site-packages/cupy_backends/cuda/libs/cusparse.cpython-37m-x86_64-linux-gnu.so: symbol cusparseConstrainedGeMM_bufferSize version libcusparse.so.10 not defined in file libcusparse.so.10 with link time reference
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home1/xuchenhao/.local/lib/python3.7/site-packages/cupy/__init__.py", line 37, in <module>
raise ImportError(_msg) from e
ImportError: CuPy is not correctly installed.
If you are using wheel distribution (cupy-cudaXX), make sure that the version of CuPy you installed matches with the version of CUDA on your host.
Also, confirm that only one CuPy package is installed:
$ pip freeze
If you are building CuPy from source, please check your environment, uninstall CuPy and reinstall it with:
$ pip install cupy --no-cache-dir -vvvv
Check the Installation Guide for details:
https://docs.cupy.dev/en/latest/install.html
original error: /home1/xuchenhao/.local/lib/python3.7/site-packages/cupy_backends/cuda/libs/cusparse.cpython-37m-x86_64-linux-gnu.so: symbol cusparseConstrainedGeMM_bufferSize version libcusparse.so.10 not defined in file libcusparse.so.10 with link time reference
My environments are:
python=3.7.6
GCC=7.3.0
cuda=10.1.168
cupy-cuda101=9.5.0
How can I fix this problem?

"Symbol not found: __dyld_shared_cache_contains_path" on OSX after installl from backup?

I've just got a new Macbook running OSX 10.15.7. I installed it from a Time Machine backup of my old machine.
Now when I try to import the ctypes library in Python:
python -c "import ctypes"
I see this:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/Cellar/python#3.9/3.9.1_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ctypes/__init__.py", line 8, in <module>
from _ctypes import Union, Structure, Array
ImportError: dlopen(/usr/local/Cellar/python#3.9/3.9.1_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/_ctypes.cpython-39-darwin.so, 2): Symbol not found: __dyld_shared_cache_contains_path
Referenced from: /usr/local/Cellar/python#3.9/3.9.1_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/_ctypes.cpython-39-darwin.so (which was built for Mac OS X 11.0)
Expected in: /usr/lib/libSystem.B.dylib
in /usr/local/Cellar/python#3.9/3.9.1_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/_ctypes.cpython-39-darwin.so
I have no idea how to debug this - can anyone advise? It means I can't run Jupyter notebooks, among other things.

exchangelib: looking for winkerberos on an OS X system

I am attempting to install exchangelib on a Mac (OS X 10.13.5). I was having issues with the install, so I created a minimal environment in which to work:
pushd /tmp
curl -SLO https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
bash ./Miniconda3-latest-MacOSX-x86_64.sh -b -p /tmp/lxml
source /tmp/lxml/bin/activate
conda create -n py35 python=3.5 lxml -y
source activate py35
I then installed exchangelib within that environment. When I attempt to use it, though, I find that it's trying to load winkerberos instead of pykerberos.
>>> import exchangelib
Traceback (most recent call last):
File "/tmp/lxml/envs/py35/lib/python3.5/site-packages/requests_kerberos/kerberos_.py", line 2, in <module>
import kerberos
ImportError: dlopen(/tmp/lxml/envs/py35/lib/python3.5/site-packages/kerberos.cpython-35m-darwin.so, 2): Symbol not found: _mempcpy
Referenced from: /tmp/lxml/envs/py35/lib/python3.5/site-packages/kerberos.cpython-35m-darwin.so
Expected in: flat namespace
in /tmp/lxml/envs/py35/lib/python3.5/site-packages/kerberos.cpython-35m-darwin.so
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/tmp/lxml/envs/py35/lib/python3.5/site-packages/exchangelib/__init__.py", line 4, in <module>
from .account import Account
File "/tmp/lxml/envs/py35/lib/python3.5/site-packages/exchangelib/account.py", line 12, in <module>
from exchangelib.services import GetUserOofSettings, SetUserOofSettings
File "/tmp/lxml/envs/py35/lib/python3.5/site-packages/exchangelib/services.py", line 37, in <module>
from .transport import wrap, extra_headers, SOAPNS, TNS, MNS, ENS
File "/tmp/lxml/envs/py35/lib/python3.5/site-packages/exchangelib/transport.py", line 9, in <module>
import requests_kerberos
File "/tmp/lxml/envs/py35/lib/python3.5/site-packages/requests_kerberos/__init__.py", line 17, in <module>
from .kerberos_ import HTTPKerberosAuth, REQUIRED, OPTIONAL, DISABLED
File "/tmp/lxml/envs/py35/lib/python3.5/site-packages/requests_kerberos/kerberos_.py", line 4, in <module>
import winkerberos as kerberos
ImportError: No module named 'winkerberos'
>>>
I'm kind of at a loss here. Any ideas how to get the install to not look for winkerberos?
It looks like it is trying to load pykerberos first, which fails with a library issue (Symbol not found: _mempcpy) and as a fallback tries to load winkerberos, which it does not find. This should start working as soon as you can make the pykerberos on your system work.

python getting Symbol not found: __PyCodecInfo_GetIncrementalDecoder

I am trying to use selenium in python and I am getting the following error:
Symbol not found: __PyCodecInfo_GetIncrementalDecoder
>>> from selenium import webdriver
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/selenium/__init__.py", line 18, in <module>
from selenium import selenium
File "/usr/local/lib/python2.7/site-packages/selenium/selenium.py", line 25, in <module>
import httplib as http_client
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 80, in <module>
import mimetools
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/mimetools.py", line 6, in <module>
import tempfile
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tempfile.py", line 32, in <module>
import io as _io
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/io.py", line 51, in <module>
import _io
ImportError: dlopen(/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder
Referenced from: /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
Expected in: flat namespace
in /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
>>>
OSX 10.11.1
python 2.7.10
I can't figure out if this is an El Capitan issue, python issue. Tried brew doctor and system is ready.
It turned out it was a python issue, after installing a new version of python. Running this solved the issue:
hash -r python
This problem is most probably caused by Brew Installed python.
The python official website provides downloads for macOS, you should download and install the official package.
The official installer will fix the python link automatic, then issue solved.

Categories

Resources