Pip install error and Setuptools.command not found - unix

I was using the guide in this link to install a package in a specific conda environment: https://github.com/alegiac95/Imaging-transcriptomics. However, I was unable to do so and had the following error. Would really appreciate the help!
Traceback (most recent call last):
File "setup.py", line 9, in
from setuptools import setup, find_packages
ImportError: No module named 'setuptools'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "setup.py", line 11, in
from distutils.core import setup, find_packages
ImportError: cannot import name 'find_packages'

Related

ModuleNotFoundError: No module named 'IPython' on logging the R model

For R model registration from jupyter to azure databricks, I was logging the R model using mlflow,
predictor <- crate(function(x) predict(model,.x))
mlflow_log_model( predictor,'MODEL')< facing error here>
Traceback (most recent call last):
File "/usr/local/anaconda3/envs/r-mlflow-1.26.1/lib/python3.7/site-packages/mlflow/utils/databricks_utils.py", line 44, in _get_dbutils
import IPython
ModuleNotFoundError: No module named 'IPython'
when I try to import IPython module using below code:
from IPython import get_ipython
I got below error:
I installed the IPython module using below command:
pip install ipython
I imported ipython module and run the below code:
import IPython
from IPython import get_ipython
from IPython.display import Image
print(Image)
print(IPython.__version__)
It executed successfully with out any error:

ImportError: libcublas when loading dataset on Rstudio running Keras with Tensorflow GPU

Ubuntu 18.04
Rstudio 3.4.4
Tensorflow 1.11.0
When I run install_keras(tensorflow="gpu")
all was good with the last few lines being:
tensorflow-gpu 1.11.0 has requirement setuptools<=39.1.0, but you'll have setuptools 40.4.3 which is incompatible.
Installing collected packages: keras, tensorflow-hub
Successfully installed keras-2.2.4 tensorflow-hub-0.1.1
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Installation complete.
Restarting R session...
I don't think the issues are related to what's coming next.
I loaded the IMDB dataset: > imdb <- dataset_imdb(num_words = 10000)
And these errors popped up:
Error: ImportError: Traceback (most recent call last):
File "/home/chubuntu/anaconda3/envs/r-tensorflow/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/chubuntu/anaconda3/envs/r-tensorflow/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/chubuntu/anaconda3/envs/r-tensorflow/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "/home/chubuntu/anaconda3/envs/r-tensorflow/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/home/chubuntu/anaconda3/envs/r-tensorflow/lib/python3.6/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: libcublas
I can load those dataset in keras with tensorflow without GPU. So what could be wrong here?

Building and Installing cx_Oracle with conda skeleton/ conda build not working

I have installed the package cx_Oracle, using conda skeleton command on my Windows 64bits machine, within Anaconda python
conda skeleton pypi cx_Oracle
af5f7daad67d6820670d582dfc045/cx_Oracle-6.0rc1.tar.gz (200 KB) for cx_Oracle.
Downloading cx_Oracle
Using cached download
Unpacking cx_Oracle...
done
when I am checking the file/ directory is finally set, I see it there
File "C:\Anaconda3_version4.3\lib\site-packages\conda_build\skeletons\pypi.py", line 339, in skeletonize
raise RuntimeError("directory already exists: %s" % dir_path)
RuntimeError: directory already exists: .\cx_oracle
but when I am calling it, it cannot be found
import cx_oracle
Traceback (most recent call last):
File "<ipython-input-3-fa7af752f8a0>", line 1, in <module>
import cx_oracle
ModuleNotFoundError: No module named 'cx_oracle'
The directory of cx_Oracle contains the files,
and know I need to build the package with conda build:
conda build cx_Oracle
Just so, it still doesn't work
Provides me the following error:
Anaconda3_version4.3\conda-bld\cx_oracle_1499164
353203\_b_env\Library\include /Tcsrc/cx_Oracle.c /Fobuild\temp.win-amd64-3.6\Rel
ease\src/cx_Oracle.obj -DBUILD_VERSION=6.0rc1
error: command 'cl.exe' failed: No such file or directory
I do not understand what else is needed to finally install the package
Thanks for reading.
Finally, I got a hint about this error thanks to the comments from #darthbith,
Building cx_Oracle requires you to have working C(++) compiler since cx_Oracle is written in C, not in Python even it's a Python module.

PyQt built on Windows: DLL load failed: The specified procedure could not be found

I've tried to build PyQt from sources (with binary Qt 5.8.0 downloaded) on my Windows 7x64.
I did it by this tutorial: https://stackoverflow.com/a/40779370/2726900
I've entered Visual Studio 2015 Command Prompt, activated vcvarsall.bat amd64, activated qtenv2.bat.
Than I configured, built and installed SIP (no errors).
Than I configured PyQt (just added --sip C:/Python35/sip.exe) and successfully built and installed PyQt.
The filed like QtCore.pyi, QtCore.pyd, QtGui.pyi, QtGui.pyd and so on really appeared in my site-packages/PyQt5 folder.
Bug when I tried to import some modules from my installed PyQt5, it failed.
>>> from PyQt5 import QtGui
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed: The specified procedure could not be found.
Cannot you tell me, how can I fix it?
python -m pip install --upgrade pyqt5

Python3, Rpy2 and R 3.1.1 ImportError undefined symbol

I used pip and installed RPy2 on my raspberry Pi 3 running Raspbian Jessie. I have a working installation of R 3.1.1 (tried upgrading to a newer version but couldn't seem to make it work). I get a strange error when I try to run python3 -m rpy2.tests. I get the following error:
$ python3 -m rpy2.tests
Traceback (most recent call last):
File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.4/dist-packages/rpy2/tests.py", line 23, in
<module>
import rpy2.tests_rpy_classic
File "/usr/local/lib/python3.4/dist-packages/rpy2/tests_rpy_classic.py",
line 3, in <module>
import rpy2.rpy_classic as rpy
File "/usr/local/lib/python3.4/dist-packages/rpy2/rpy_classic.py", line 5,
in <module>
import rpy2.rinterface as ri
File "/usr/local/lib/python3.4/dist-packages/rpy2/rinterface/__init__.py",
line 92, in <module>
from rpy2.rinterface._rinterface import (baseenv,
ImportError: /usr/local/lib/python3.4/dist-
packages/rpy2/rinterface/_rinterface.cpython-34m.so: undefined symbol:
installChar
Can anyone point me to what I need to do to fix this?
Thanks!
I also had the same error: it ended up being due to the version of R (3.1.0 or 3.2.0).
Updating to R 3.4.0 fixed it.

Resources