I have a laptop with Windows 10 Pro with Python 3.6.
This is my pip freeze on Windows:
numpy==1.19.5
absl-py==0.10.0
aiofiles==0.6.0
aiohttp==3.7.3
APScheduler==3.6.3
astor==0.8.1
async-generator==1.10
async-timeout==3.0.1
attrs==20.3.0
bidict==0.21.2
blis==0.7.4
boto3==1.16.50
botocore==1.19.50
bz2file==0.98
cached-property==1.5.2
cachetools==4.2.0
catalogue==1.0.0
certifi==2020.12.5
cffi==1.14.4
chardet==3.0.4
click==7.1.2
cloudpickle==1.6.0
colorama==0.4.4
colorclass==2.2.0
coloredlogs==10.0
colorhash==1.0.3
ConfigArgParse==1.2.3
contextvars==2.4
cryptography==3.3.1
cycler==0.10.0
cymem==2.0.5
dataclasses==0.8
decorator==4.4.2
dill==0.3.3
dnspython==1.16.0
docopt==0.6.2
dopamine-rl==3.0.1
fbmessenger==6.0.0
Flask==1.1.2
future==0.18.2
gast==0.2.2
gevent==1.5.0
gin-config==0.4.0
google-api-core==1.24.1
google-api-python-client==1.12.8
google-auth==1.24.0
google-auth-httplib2==0.0.4
google-pasta==0.2.0
googleapis-common-protos==1.52.0
greenlet==0.4.17
grpcio==1.34.0
gunicorn==20.0.4
gym==0.18.0
h11==0.8.1
h2==3.2.0
h5py==3.1.0
hpack==3.0.0
hstspreload==2020.12.22
httpcore==0.3.0
httplib2==0.18.1
httptools==0.1.1
httpx==0.9.3
humanfriendly==9.1
hyperframe==5.2.0
idna==2.10
idna-ssl==1.1.0
immutables==0.14
importlib-metadata==3.3.0
importlib-resources==4.1.1
itsdangerous==1.1.0
Jinja2==2.11.2
jmespath==0.10.0
jsonpickle==1.4.2
jsonschema==3.2.0
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.2
kfac==0.2.0
kiwisolver==1.3.1
Markdown==3.3.3
MarkupSafe==1.1.1
matplotlib==3.3.3
mattermostwrapper==2.2
mesh-tensorflow==0.1.18
mpmath==1.1.0
multidict==4.6.1
murmurhash==1.0.5
networkx==2.3
oauth2client==4.1.3
opencv-python==4.5.1.48
opt-einsum==3.3.0
packaging==19.2
pika==1.0.1
Pillow==7.2.0
plac==1.1.3
preshed==3.0.5
promise==2.3
prompt-toolkit==3.0.9
protobuf==3.14.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.20
pydot==1.4.1
pyglet==1.5.0
PyJWT==1.7.1
pykwalify==1.7.0
pymongo==3.11.2
pyparsing==2.4.7
pypng==0.0.20
pyreadline==2.1
pyrsistent==0.17.3
python-crfsuite==0.9.7
python-dateutil==2.8.1
python-engineio==4.0.0
python-socketio==5.0.4
python-telegram-bot==11.1.0
pytz==2019.3
PyYAML==5.3.1
questionary==1.9.0
rasa==1.6.0
rasa-sdk==1.6.1
redis==3.3.11
requests==2.25.1
requests-async==0.5.0
requests-toolbelt==0.9.1
rfc3986==1.4.0
rocketchat-API==0.6.36
rsa==4.6
ruamel.yaml==0.15.100
s3transfer==0.3.3
sanic==19.9.0
Sanic-Cors==0.9.9.post1
sanic-jwt==1.5.0
Sanic-Plugins-Framework==0.9.4.post1
scikit-learn==0.20.4
scipy==1.5.4
six==1.15.0
sklearn-crfsuite==0.3.6
slackclient==1.3.2
sniffio==1.2.0
spacy==2.3.5
SQLAlchemy==1.3.22
srsly==1.0.5
sympy==1.7.1
tabulate==0.8.7
tensor2tensor==1.14.1
tensorboard==1.15.0
tensorflow==1.15.3
tensorflow-datasets==3.1.0
tensorflow-estimator==1.15.1
tensorflow-gan==2.0.0
tensorflow-hub==0.11.0
tensorflow-metadata==0.26.0
tensorflow-probability==0.7.0
termcolor==1.1.0
terminaltables==3.1.0
thinc==7.4.5
tqdm==4.55.1
twilio==6.50.1
typing-extensions==3.7.4.3
tzlocal==2.1
uritemplate==3.0.1
urllib3==1.26.2
wasabi==0.8.0
wcwidth==0.2.5
webexteamssdk==1.6
websocket-client==0.54.0
websockets==8.1
Werkzeug==1.0.1
wrapt==1.12.1
yarl==1.6.3
zipp==3.4.0
The project I'm working on uses Rasa 1.6.0 and with these requirements, everything runs as expected on Windows.
However, for a specific task, I need to be on Ubuntu and so I installed Ubuntu 18.04 on a VirtualBox 6.1 machine, installed python and pip and run pip install -r requirements.txt command to install the exact same requirements on that machine, inside a virtual environment.
After this, if I try to run rasa train on a shell or import tensorflow as tf on a python console, an error appears:
Illegal instruction (core dumped)
Any ideias on what the cause for this error could be ?
I saw some people saying it could be some incompatibility of tensorflow with the architecture of the processor being used, however in my case that should not be the problem since everything works on Windows (right ?).
I also tried to uninstall tensorflow and followed some online tutorials to Build from source but now, when I run rasa --version, tensorflow is no longer found:
$ rasa --version
Traceback (most recent call last):
File "/home/<USER>/Desktop/venv_rasa/bin/rasa", line 8, in <module>
sys.exit(main())
File "/home/<USER>/Desktop/venv_rasa/lib/python3.6/site-packages/rasa/__main__.py", line 69, in main
set_log_level(log_level)
File "/home/<USER>/Desktop/venv_rasa/lib/python3.6/site-packages/rasa/utils/common.py", line 68, in set_log_level
update_tensorflow_log_level()
File "/home/<USER>/Desktop/venv_rasa/lib/python3.6/site-packages/rasa/utils/common.py", line 108, in update_tensorflow_log_level
import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'
But, inside a Python console, I can import tensorflow but if I try so access anything, other errors are shown:
>>> import tensorflow as tf
>>> tf.__version__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'tensorflow' has no attribute '__version__'
>>>
>>> mnist = tf.keras.datasets.mnist
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'tensorflow' has no attribute 'keras'
Am I missing anything ?
Am I doing something wrong ?
Thanks in advance!
I saw some people saying it could be some incompatibility of tensorflow with the architecture of the processor being used, however in my case that should not be the problem since everything works on Windows (right ?).
I think this may in fact be your problem. When you're using VirtualBox, you're no longer in the same environment as on your windows machine, and you could be running into incompatibilities there that were not happening in your local windows environment.
The fact that the module you built from source is not found, is most likely because it isn't in your PYTHONPATH.
I would recommend using a virtual environment and following e.g. these instructions for installing tensorflow on Ubuntu, since that's what your VirtualBox is running: https://linuxize.com/post/how-to-install-tensorflow-on-ubuntu-18-04/
Related
While using the IBM Quantum experience, whenever I want to install any driver an error with the h5py appears.
Specifically, the error is
"Using default_file_mode other than 'r' is no longer supported. Pass
the mode to h5py.File() instead."
Does anyone have any solutions to it (not sure which version to revert back to). Thanks!!
You will need to add more details about your question. I could not replicate your error based on the information you provided. This is what I did:
First, I installed Qiskit Nature with this command pip install qiskit[nature].
Next, I entered the following Python commands:
>>> from qiskit_nature.drivers.second_quantization import HDF5Driver
>>> h5f = HDF5Driver()
>>> h5f
<qiskit_nature.drivers.second_quantization.hdf5d.hdf5driver.HDF5Driver object at 0x7fa28320a820>
>>> h5f.run()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/qiskit_nature/drivers/second_quantization/hdf5d/hdf5driver.py", line 63, in run
raise LookupError(f"HDF5 file not found: {hdf5_file}")
LookupError: HDF5 file not found: molecule.hdf5
There is no error when I imported the HDF5Driver module from the qiskit_nature package. An error occurs when I enter h5f.run(). This is expected, because I don't have a file named molecule.hdf5 (the default filename). If you have a different filename, modify commands above to use h5f = HDF5Driver("your_filename").
Tests run with Python 3.8.12 and qiskit_nature 0.3.0 running on Ubuntu Linux 5.11.0-1023-gcp.
Python noob here. I've been trying to install pygame and pandas for a few hours now. Even with Conda I did not succeed. I have Python 3.8.5 installed.
I eventually tried through the terminal with these commands:
python -m pip install pygame==2.0.0.dev6
and
python -m pip install pandas
(this was a total guess by the way, but apparently it did something)
Results were succesfull:
Requirement already satisfied: pygame==2.0.0.dev6 in /opt/miniconda3/lib/python3.8/site-packages (2.0.0.dev6)
and
Successfully installed numpy-1.19.2 pandas-1.1.2 python-dateutil-2.8.1 pytz-2020.1
But, when I try to import either modules, I still get errors. Any ideas?
import pygame
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import pygame
ModuleNotFoundError: No module named 'pygame'
import pandas
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import pandas
ModuleNotFoundError: No module named 'pandas'
Do I need to move the modules to the script folder or something? Or what do I even move? Thanks!
Ok.. Got it thanks to #matt.. after succesfully installing pygame, find the environment in which pygame is installed by entering 'which python'.
In my case it returned:
/opt/miniconda3/bin/python
Now I needed to make sure the VS console was pointing at the same environment, by checking which python interpreter it was using and selecting the correct one. More info:
how to check and change environment in VS Code
I am trying to run a python package that requires pytorch-gpu. I have change the runtime type of my Colab notebook to GPU. When I run the command, I am facing the following error. Not sure if I am able to build pytorch on colab myself?
Traceback (most recent call last):
File "inference_unet.py", line 9, in <module>
import torchvision.transforms as transforms
File "/usr/local/lib/python3.6/dist-packages/torchvision/__init__.py", line 10, in <module>
from .extension import _HAS_OPS
File "/usr/local/lib/python3.6/dist-packages/torchvision/extension.py", line 58, in <module>
_check_cuda_version()
File "/usr/local/lib/python3.6/dist-packages/torchvision/extension.py", line 54, in _check_cuda_version
.format(t_major, t_minor, tv_major, tv_minor))
RuntimeError: Detected that PyTorch and torchvision were compiled with different CUDA versions. PyTorch has CUDA Version=10.2 and torchvision has CUDA Version=10.1. Please reinstall the torchvision that matches your PyTorch install.
Now you can directly use pytorch-gpu on google colab, no need of installation.
Just change your runtime to gpu, import torch and torchvision and you are done.
I have attached screenshot doing just the same.
Hope the answer will find helpful.
But in case you want to install different version of pytorch or any other package then you can install using pip, just add ! before your pip command and run the cell.
for example,
I am using python 3.7
Recently I started getting this error while importing sklearn module.
I get the same error in Jupyter Notebook, Python IDLE, Pycharm virtual environment
>>> import sklearn
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\aditya\AppData\Roaming\Python\Python37\site-packages\sklearn\__init__.py", line 75, in <module>
from .utils._show_versions import show_versions
File "C:\Users\aditya\AppData\Roaming\Python\Python37\site-packages\sklearn\utils\_show_versions.py", line 12, in <module>
from ._openmp_helpers import _openmp_parallelism_enabled
ImportError: DLL load failed: The specified module could not be found.
I have tried reinstalling too.
After that I copied contents of sklearn of venv of another project which had no issues. This thing worked for couple of times. But now it's not working again
Note: pandas, numpy, scipy etc are installed and working absolutely fine. Sklearn was also working fine few days back
This is an issue in the packaging in scikit-learn 0.22.0 which will be solved in 0.22.1 (released next week). The issue is tracked at: github.com/scikit-learn/scikit-learn/issues/15899. There are 2 possible workarounds:
Install scikit-learn from conda-forge (conda include the missing dll) by default: conda install conda-forge::scikit-learn
Install VC++ which will have the openmp library (https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads)
Would appreciate an explanation like I'm 5 simply because I have checked all relevant answers and none have helped.
I have installed Python.
I have installed Pycharm.
I have installed Anaconda.
I have installed Microsoft Visual Studio.
I have not installed the CUDA toolkit.
In Anaconda, I used the commands mentioned on Pytorch.org (06/05/18)
conda install pytorch -c pytorch
pip3 install torchvision
Both have downloaded and installed properly, and I can find them in my Users/Anaconda3/pkgs folder, which I have added to the Python path.
Trying to enter
import torch
in the Python console proved unfruitful - always giving me the same error,
No module named 'torch'
I have also tried using the Project Interpreter to download the Pytorch package. It worked for numpy (sanity check, I suppose) but told me to go to Pytorch.org when I tried to install the "pytorch" or "torch" packages.
When trying to use the console in PyCharm, pip3 install codes (thinking maybe I need to save the packages into my current project, rather than in the Anaconda folder) return me an error message saying
torch-0.4.0-cp35-cp35m-win_amd64.whl is not a supported wheel on this
platform.
The same message shows no matter if I try downloading the CUDA version or not, or if I choose to use the 3.5 or 3.6 Python link (I have Python 3.7)
Currently the closest I have gotten to a solution, is manually copying the "torch" and "torch-0.4.0-py3.6.egg-info" folders into my current Project's lib folder.
However, when I do that and then run "import torch" I received the following error:
Traceback (most recent call last):
File "", line 1, in
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.2\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 19, in do_import
module = self._system_import(name, *args, **kwargs) File "C:\Users\Michael\PycharmProjects\Pytorch_2\venv\lib\site-packages\torch__init__.py",
line 78, in
from torch._C import *
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.2\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 19, in do_import
module = self._system_import(name, *args, **kwargs) ModuleNotFoundError: No module named 'torch._C'
pip uninstall torch
then
pip install torch worked for me.
I encountered the same problem because I updated my python from 3.5 to 3.6 yesterday. I think the connection between Pytorch and Python is not correctly changed. Thus, I installed Pytorch for 3.6 again and the problem is solved.
Check the install command line here[1].