Issue:
I am installing snips in docker with step 1 given in To Reproduce section. I am ending with No module named 'distutils.msvccompiler' error. I am running everything on Linux based system. is there alternative way to install snips-nlu in docker?
To Reproduce
Created installSnips.sh (following) file for installing rust, rust setup tool
pip3 install numpy
pip3 install scipy
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
pip3 install setuptools-rust
source ~/.cargo/env
pip3 install snips-nlu
while running installSnips.sh pip3 install snip-nlu enter in following error
Building wheel for scikit-learn (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [26 lines of output]
Partial import of sklearn during the build process.
/tmp/pip-install-h9opcxf9/scikit-learn_fc42ebd0e5804549ad6f611dced79620/setup.py:123: DeprecationWarning:
`numpy.distutils` is deprecated since NumPy 1.23.0, as a result
of the deprecation of `distutils` itself. It will be removed for
Python >= 3.12. For older Python versions it will remain present.
It is recommended to use `setuptools < 60.0` for those Python versions.
For more details, see:
https://numpy.org/devdocs/reference/distutils_status_migration.html
from numpy.distutils.command.build_ext import build_ext # noqa
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-h9opcxf9/scikit-learn_fc42ebd0e5804549ad6f611dced79620/setup.py", line 303, in <module>
setup_package()
File "/tmp/pip-install-h9opcxf9/scikit-learn_fc42ebd0e5804549ad6f611dced79620/setup.py", line 295, in setup_package
from numpy.distutils.core import setup
File "/home/drjslab/.local/lib/python3.10/site-packages/numpy/distutils/core.py", line 24, in <module>
from numpy.distutils.command import config, config_compiler, \
File "/home/drjslab/.local/lib/python3.10/site-packages/numpy/distutils/command/config.py", line 19, in <module>
from numpy.distutils.mingw32ccompiler import generate_manifest
File "/home/drjslab/.local/lib/python3.10/site-packages/numpy/distutils/mingw32ccompiler.py", line 28, in <module>
from distutils.msvccompiler import get_build_version as get_build_msvc_version
ModuleNotFoundError: No module named 'distutils.msvccompiler'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for scikit-learn
Running setup.py clean for scikit-learn
Failed to build scikit-learn
Installing collected packages: requests, pyaml, packaging, scikit-learn, deprecation
Attempting uninstall: scikit-learn
Found existing installation: scikit-learn 1.1.2
Uninstalling scikit-learn-1.1.2:
Successfully uninstalled scikit-learn-1.1.2
Running setup.py install for scikit-learn ... error
error: subprocess-exited-with-error
× Running setup.py install for scikit-learn did not run successfully.
│ exit code: 1
╰─> [26 lines of output]
Partial import of sklearn during the build process.
/tmp/pip-install-h9opcxf9/scikit-learn_fc42ebd0e5804549ad6f611dced79620/setup.py:123: DeprecationWarning:
`numpy.distutils` is deprecated since NumPy 1.23.0, as a result
of the deprecation of `distutils` itself. It will be removed for
Python >= 3.12. For older Python versions it will remain present.
It is recommended to use `setuptools < 60.0` for those Python versions.
For more details, see:
https://numpy.org/devdocs/reference/distutils_status_migration.html
from numpy.distutils.command.build_ext import build_ext # noqa
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-h9opcxf9/scikit-learn_fc42ebd0e5804549ad6f611dced79620/setup.py", line 303, in <module>
setup_package()
File "/tmp/pip-install-h9opcxf9/scikit-learn_fc42ebd0e5804549ad6f611dced79620/setup.py", line 295, in setup_package
from numpy.distutils.core import setup
File "/home/drjslab/.local/lib/python3.10/site-packages/numpy/distutils/core.py", line 24, in <module>
from numpy.distutils.command import config, config_compiler, \
File "/home/drjslab/.local/lib/python3.10/site-packages/numpy/distutils/command/config.py", line 19, in <module>
from numpy.distutils.mingw32ccompiler import generate_manifest
File "/home/drjslab/.local/lib/python3.10/site-packages/numpy/distutils/mingw32ccompiler.py", line 28, in <module>
from distutils.msvccompiler import get_build_version as get_build_msvc_version
ModuleNotFoundError: No module named 'distutils.msvccompiler'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
Rolling back uninstall of scikit-learn
Moving to /home/drjslab/.local/lib/python3.10/site-packages/scikit_learn-1.1.2.dist-info/
from /home/drjslab/.local/lib/python3.10/site-packages/~cikit_learn-1.1.2.dist-info
Moving to /home/drjslab/.local/lib/python3.10/site-packages/scikit_learn.libs/
from /home/drjslab/.local/lib/python3.10/site-packages/~cikit_learn.libs
Moving to /home/drjslab/.local/lib/python3.10/site-packages/sklearn/
from /home/drjslab/.local/lib/python3.10/site-packages/~klearn
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> scikit-learn
note: This is an issue with the package mentioned above, not pip.
Environment:
Base OS: Ubuntu 20.04
Base Python version: 3.8
snips-nlu version:Latest
Docker OS: Ubuntu 20.04
Docker Python: 3.10.4
It seems a recent update of setuptools broke numpy.distutils which is a dependency of scikit-learn.
https://github.com/pypa/setuptools/pull/3505
A reported possible solution is to install setuptools<65 with pip install --no-use-pep517
Related
I'm following Drake's installation instructions from here for ubuntu.
I get stuck at this line:
python3 -c 'import pydrake; print(pydrake.__file__)'
with the following error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/opt/drake/lib/python3.6/site-packages/pydrake/__init__.py", line 41, in <module>
from . import common
File "/opt/drake/lib/python3.6/site-packages/pydrake/common/__init__.py", line 7, in <module>
from ._module_py import *
ModuleNotFoundError: No module named 'pydrake.common._module_py'
What is the ._module_py file? I don't see it in:
/opt/drake/lib/python3.6/site-packages/pydrake/common
The python version I've got installed is 3.8.5, but I don't think that's causing any problems.
The instructions you linked to say curl -o drake.tar.gz https://drake-packages.csail.mit.edu/drake/nightly/drake-latest-bionic.tar.gz. The "bionic" there is Ubuntu's codename for 18.04. If you are using Ubuntu 20.04, then the codename is "focal", so you should use start from curl -o drake.tar.gz https://drake-packages.csail.mit.edu/drake/nightly/drake-latest-focal.tar.gz so that you have Python 3.8 support.
Here are Drake's own installation instructions for pydrake, which are usually the most up-to-date reference: https://drake.mit.edu/python_bindings.html#installation
I am getting the following error when I try to load the Tensorflow Federated library on a server. I am using tensorflow_federated version 0.13.1
The Cuda version I have on the server is 10.2 . The Cudnn library is above 7.6.
What is the "libnvinfer.so.6" that is being asked?
2020-03-28 17:26:18.357394: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer.so.6'; dlerror: libnvinfer.so.6: cannot open shared object file: No such file or directory
2020-03-28 17:26:18.410547: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer_plugin.so.6'; dlerror: libnvinfer_plugin.so.6: cannot open shared object file: No such file or directory
2020-03-28 17:26:18.464258: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:30] Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
Traceback (most recent call last):
File "FedAvgREALWORLDWork.py", line 52, in <module>
import tensorflow_federated as tff
File "/user/env/lib/python3.5/site-packages/tensorflow_federated/__init__.py", line 61, in <module>
from tensorflow_federated.python import learning
File "/user/env/lib/python3.5/site-packages/tensorflow_federated/python/learning/__init__.py", line 17, in <module>
from tensorflow_federated.python.learning import framework
File "/user/env/lib/python3.5/site-packages/tensorflow_federated/python/learning/framework/__init__.py", line 20, in <module>
from tensorflow_federated.python.learning.framework.optimizer_utils import build_model_delta_optimizer_process
File "/user/env/lib/python3.5/site-packages/tensorflow_federated/python/learning/framework/optimizer_utils.py", line 176
f'({old_value.dtype}, {old_value.shape}) != '
^
SyntaxError: invalid syntax
I think that you have some librares are missing "libvinfer", for example to continue install cuda 10.1 you must install these packages
# Install TensorRT. Requires that libcudnn7 is installed above.
sudo apt-get install -y --no-install-recommends \
libnvinfer6=6.0.1-1+cuda10.1 \
libnvinfer-dev=6.0.1-1+cuda10.1 \
libnvinfer-plugin6=6.0.1-1+cuda10.1
I suggest that you See this : https://www.tensorflow.org/install/gpu
I hope that help you
I had installed numpy on alpine docker and everything looked good before running numpy:
Traceback (most recent call last):
File "/app/venv/lib/python3.7/site-packages/numpy/core/__init__.py", line 24, in <module>
from . import multiarray
File "/app/venv/lib/python3.7/site-packages/numpy/core/multiarray.py", line 14, in <module>
from . import overrides
File "/app/venv/lib/python3.7/site-packages/numpy/core/overrides.py", line 7, in <module>
from numpy.core._multiarray_umath import (
ImportError: Error loading shared library libcblas.so.3: No such file or directory (needed by /app/venv/lib/python3.7/site-packages/numpy/core/_multiarray_umath.cpython-37m-x86_64-linux-gnu.so)
I found that licblas.so might be in /usr/lib/ as mentioned here: alpine blas
but it wasn't there.
After installing lapack, the missing file libcblas.so.3 appeared in /usr/lib/:
apk add lapack
I had openblas-dev installed from before but that was not sufficient.
Followed through installation tips, but after typing
$ python underactuated/src/double_pendulum/simulate.py
I get
ImportError: dynamic module does not define init function (init_module_py).
If I run python3 I get
ImportError: cannot import name 'FindResource'.
After typing $ python3 -c 'import pydrake; print(pydrake.__file__)' I get /opt/drake/lib/python3.6/site-packages/pydrake/__init__.py
Edit:
Full output of running python3
Traceback (most recent call last):
File "underactuated/src/double_pendulum/simulate.py", line 5, in <module>
from underactuated import FindResource, PlanarSceneGraphVisualizer
ImportError: cannot import name 'FindResource'
And full output of running python (without3):
Traceback (most recent call last):
File "underactuated/src/double_pendulum/simulate.py", line 1, in <module>
from pydrake.all import (AddMultibodyPlantSceneGraph,
File "/opt/drake/lib/python3.6/site-packages/pydrake/__init__.py", line 32, in <module>
from . import common
File "/opt/drake/lib/python3.6/site-packages/pydrake/common/__init__.py", line 3, in <module>
from ._module_py import *
ImportError: dynamic module does not define init function (init_module_py)
Version of python after typing python -V is Python 2.7.15+
The fact that the print test succeeds suggests that drake is installed correctly.
Please post the full output of running simulate.py with python3.
I have a docker image with python 2.7. I am trying to install airflow in the image, but during the pip installation of the airflow dependencies I am getting the below issues.
Dockerfile:-
FROM python:2.7-slim
...
...
# Install Airflow and Celery
COPY pip_airflow.txt /pip_airflow.txt
RUN pip install --no-cache-dir -r /pip_airflow.txt
Below is my pip_airflow.txt file.
apache-airflow[all]==1.10.0
celery[redis]>=4.2.1,<4.3.0
flower>=0.7.3,<1.0
kombu>=4.2.0,<5.0
Logs:- The failure is when the pip install for airflow is happening from the dockerfile.
Collecting pendulum==1.4.4 (from apache-airflow[all]==1.10.0->-r /pip_airflow.txt (line 1))
Downloading https://files.pythonhosted.org/packages/85/a5/9fc15751f9725923b170ad37d6c61031fc9e941bafd5288ca6ee51233284/pendulum-1.4.4.tar.gz (74kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'error'
Complete output from command /usr/local/bin/python /usr/local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpnYnATX:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 207, in <module>
main()
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 197, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 54, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-OXncUe/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 130, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-OXncUe/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 112, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-OXncUe/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 126, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 47, in <module>
from build import *
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/pep517/build.py", line 7, in <module>
from pip._vendor import pytoml
ImportError: No module named pip._vendor
Update pip, e.g. pip install pip===19.0.2.
In my case it worked.