This's my first time to ask question on stack overflow, thanks for the browse of my question!
While I'm trying to debug a program(written in python) in Visual Studio Code, as I enter "python .\dnn_example.py", it doesn't output the result, but blocked out this message(the white frame, and it means "which software do I prefer to use to open the file):enter image description here
Then I saw a message from "PROBLEMS":enter image description here
It reads "unable to import tensorflow".
I'm keep trying fixing the problem, thanks for your help!
It seems like you have not installed tensorflow. Try installing it using conda by conda install tensorflow or if you don't use conda, install it using pip by pip install tensorflow.
If you want to run tensorflow on GPU then follow this tutorial.
Related
I'm a beginner in Deep Learning and NLP stream. I was trying to install Tensorflow but it is giving me an error. Can anyone please help me how to solve this?
This is the error I'm getting
I was watchig an YouTube video for Toxic Comment Classification and thought should try that out for better practice. After creating an enviroment for the file I triedd to install Tensorflow but it threw this error. I updated my Anaconda, Updated python to 3.11 and pip to 22.3 but still it is not working.
Welcome to Stack Overflow!!
Have you tried installing each package indivually?
Like this
pip install tensorflow
pip install tensorflow-gpu
And so on
I ran your CLI commands from the picture separately as-well.
The error you are getting is from tensorflow-gpu command.
I've found a link for you, from where you can learn about it. [link]
I'm working with a python notebook in Dataiku, I used gensmin package and it worked fine till last week.
Now I've tried to pip install gensim again, and at first it seems that it loads the chached package:
'Using cached gensim-4.2.0.tar.gz'
But at the end I get a fatal error attached in the image below.
error
I appreciate any help!
From Dataiku support:
Navigate to Administrations>Code Envs>Python_xxx and add gensim in
Requested packages.
If the code-environment update fails, please reach out to the admin to
install the system package python3-devel. The admin should be able
to install this depending on the OS the DSS is installed.
I'm trying to run some old code from gaussian filter when I find out that python launcher gets stuck trying to do the imshow function.
I tried:
Used Matplotlib to display a graph to see if the python launcher was the problem but no, graph showed up fine.
Remove process in between just to have the image read and display in fear that something in my code was breaking the launcher but no success.
Reinstalled opencv-python but no success.
Also saw one question like this in the google search but OP deleted it.
Has anyone encounter this issue or has any fix for this?
Example code:
import cv2 as cv
filename = 'chessboard.png'
img = cv.imread(filename)
cv.imshow('dst',img)
cv.waitKey(0)
OS: MacOS Big Sur (11.0.1)
I resolved the issue with below steps:
Install the anaconda.
Install the libraries needed.
Run the script, there is an error appeared as below:
You might be loading two sets of Qt binaries into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.
then I installed two libraies:
pip install opencv-python opencv-python-headless
Retry run the script, the image can be shown on the left top of the monitor.
I was also facing the same problem. I solved it by just installing opencv-python-headless. use:
pip install opencv-python-headless
I also encounter this problem when I upgraded to Big Sur.
Uninstall anaconda(every package), and reinstall python.
pip install opencv-python opencv-python-headless
This does help me with imshow() but I can't run cv.face. This attribute is not found.
This solve my problem
pip install --force-reinstall opencv-contrib-python==4.1.2.30
This downgrade gets my code working again.
I naturally have my environment installed in anaconda.
I had to use the package
opencv-python-headless.
It is now running again.
Also the
cv.imread(...)
method
I also ran into this problem after installing macOS Big Sur. It was not only cv2.imshow() that did not respond but also cv2.namedWindow()
cv2.imread() was working however.
Solution was to install opencv-python-headless as others have said before
I had the same problem as you. I solved it by installing anaconda and using anaconda's virtual environment(PyCharm)
import cv2 as cv
import matplotlib.pyplot as plt
filename = 'chessboard.png'
img = cv.imread(filename)
cv.imshow('dst',img)
cv.waitKey(0)
I also found that pc hangs up at cv.imread(...).
Nothing was happened.
So I added line 2 import matplotlib.pyplot ...,
the image was displayed.
It seems to be a package reference issue. My solution solves the issue:
re-create conda env
re-install package, incl. opencv-python-headless
This is the snap of the error that I face (Click this link to watch)
This is common problem in Mac, not only in the Big Sur but also in the Catalina and others too.
and I solved this using a single command.
pip install opencv-python-head
And here watch the problem is solved now (Click this link to watch)
pywhatkit, requests, and pillow are already installed in my system. But, during importing any one of these, ImportError occurs.
After installing it through jupyter notebook, I still got the same error.
Actually I am a student and a noob in this field, so you can underestimate me. and feel free to help.
I think you are using python 2 instead of python 3. This particular error happens to me too. I think it might help.
Installing via pip on your local won’t necessarily install it for the kernel in your jupyter notebook. I typically write something like %pip install {libraries_here} into a cell. After running that cell, I restart the kernel and the packages should be there.
I am new to Python and I am trying to build a recommendation engine by following a tutorial. The tutorials asks me to install turicreate, I am running Spyder 3.3.0 (Python version 3.5) on Anaconda.
WHAT I TRIED -
I sought help from various SO questions as well as github, but none helped. I tried using "pip" and it gave the following error-
Failed building wheel for turicreate
Running setup.py clean for turicreate
Failed to build turicreate
Tried "conda install ", but error again.
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:- turicreate
My "pip" and "conda" and "anaconda" are up to date. I tried creating a virtual environment and then installing "turicreate", but didn't help. I visited the anaconda.org website which had "conda install -c derickl turicreate", I tried, which gave the following error.
PackagesNotFoundError: The following packages are not available from current channels:- turicreate
Any help would be much appreciated.
If you go to the page of the turicreate package on the Python repository index (PyPI), you will find that it can only be installed natively on Linux and macOS.
The only way to use it on Windows is through the Windows Subsystem for Linux, and for that you need to install Anaconda or Python on it (I think, I've never used WSL).
I think your problem already solved :). But I had a similar problem and I solved it using a different way. I am posting it because I think it will help someone in the future. First, I want to say, If you are following something like a Video tutorial as mentioned in the question above, use that method. Thanks!
First Goto this Link URL. It will navigate you to colab with python version 2.
My runtime settings as follows. Runtime type: python 2 | Hardware accelerator:
TPU
Then run !pip install turicreate and after finishing installation it will say You must restart the runtime in order to use newly installed versions.After restart your runtime you will able to use turicreate with colab.
I hope it will help someone!