the imageai module requires Pytorch to work in Python3.10 - python-3.x

I am trying to install imageai in Python3.10. It is installed but when I import the module imageai, it requires installing pytorch and torchvision:
Dependency error!!! PyTorch and TorchVision are not installed. Please see installation instructions in the documentation https://imageai.readthedocs.io/
I installed Pytorch and Torchvision using the below commands in CMD:
pip3.10 install torch pip3.10 install torchvision
Yet I receive the above dependency error when I import imageai. Any idea?

I had the same problem. Try to use the exact versions of the dependencies listed in the instructions of imageai.
I have uninstalled all modules first, then installed with the exact versions and the problem is solved.
I am using python 3.8.5.
I hope this works with you also.

Related

No module found torch

I am using jetson NX xavier kit having cuda 10.2.89, open Cv 4.1.1 and tensorRT 7.1.3 . Trying to install pytorch. Tried installing with this line
conda install pytorch torchvision cpuonly -c pytorch
but when i write this line
import torch
It throws an error by saying that module not installed.
How I can verify if pytorch has been installed correctly.
Try this one
conda install -c pytorch pytorch
After executing this command, you need to enter yes(if prompted in the command line) for installing all the related packages. If there is no conflict while installing the libraries, the PyTorch library will be installed.
To check if it is properly installed or not, type the command python in your command line and type import torch to check if it is properly installed or not.

Importing Tensorflow on Python 3.6, 3.7, 3.8

I have a problem with importing TensorFlow. I have tried multiple versions of Numpy, Python, and TensorFlow and I still get the following error:
struct_pb2.TypeSpecProto.NDARRAY_SPEC
AttributeError: NDARRAY_SPEC
I have tried using conda and pip for installation and neither one works. I have no idea what might be the cause of this problem and it started happening about a week ago before that TensorFlow was working fine!
I believe you are using windows, and you have an incompatible version of tensorflow installed or you are missing a dependency. First make sure you have the following installed correct version of Visual C++ installed for your version of windows.
https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0
https://aka.ms/vs/16/release/vc_redist.x64.exe here is the direct link.
If it still doesn't work, enable longpaths,
https://superuser.com/questions/1119883/windows-10-enable-ntfs-long-paths-policy-option-missing
If you are having a clash with other packages, create a new conda environment first if you haven't already, and install tensorflow like this.
conda create -n tfenv
conda activate tfenv
conda install tensorflow
Then try to import tensorflow as tf again.

Anaconda error while installing pytorch on windpws

I am running anaconda on windows; When i try to install pytorch in the anaconda prompt I get the following error
ModuleNotFoundError: No module named 'torchvision'
i checked the openssl version via conda list and it is 1.1.g3
I also moved the lib crypto and libssl from the anaconda/library/bin to anaconda3/DLLs (as per one the prior solutions.
What could be the issue? Please help
Use the commands given in the official pytorch website. Or you can use pip to install too. Commands for both conda and pip are given in pytorch website.

mystic 0.3.3 has requirement numpy<1.16.0,>=1.0, but you'll have numpy 1.16.2 which is incompatible

I'm using python 3.7 on my windows 10 system.I'm trying to install library reuqests. So I used following code
pip install requests
I got the error message
mystic 0.3.3 has requirement numpy<1.16.0,>=1.0, but you'll have numpy 1.16.2 which is incompatible.
Can you suggest me how to resolve this issue?
I got same issue during fastai package installation, uninstalled numpy and installing mystic package using anaconda prompt fixed the issue
pip uninstall numpy
pip install mystic

Installing Blocks on Linux

I'm trying to install Blocks on my Linux machine and I have some troubles. How can I fix this? I'm doing the following steps:
Installing Anaconda for python2.
Theano depends on numpy 1.10.1 version. If at this step I will run import theano in python shell then it will work perfectly.
Okay, it's time for Blocks. I'm installing stable version using pip install --user git+git://github.com/mila-udem/blocks.git \
-r https://raw.githubusercontent.com/mila-udem/blocks/master/requirements.txt
After this step if I import theano it gives the following: RuntimeError: module compiled against API version a but this version of numpy is 9.
I looked at requirements.txt and see that Blocks depends on numpy 1.9.3.
I uninstalled Theano, Blocks, downgraded numpy using conda install numpy=1.9.3, then just run again pip install --user git+git://github.com/mila-udem/blocks.git \
-r https://raw.githubusercontent.com/mila-udem/blocks/master/requirements.txt and still while importing theano it gives me RuntimeError: module compiled against API version a but this version of numpy is 9.
How can I overcome this problem?
This could be a problem with the Anaconda distribution. You could try updating all of Anaconda via conda update conda and conda update --all. You could also try changing Blocks requirements.txt to refer to numpy 1.10.1 since it's likely that Blocks won't care about the changes from 1.9 to 1.10.
– Daniel Renshaw

Resources