scipy definitely installed but will not import [duplicate] - python

This question already has answers here:
AttributeError: 'module' object (scipy) has no attribute *** Why does this error occur?
(3 answers)
Closed 3 years ago.
I am trying to install scipy for python 3.7 and it seems to install correctly, I have been installing it through pip using the command:
python -m pip install scipy
The installer says that it has successfully installed scipy-1.2.1 , however, when I try to use it in the console or any IDE it claims that scipy does not contain the attribute
AttributeError: module 'scipy' has no attribute 'integrate'
Please help.

I supposes you're using Windows, the short way to solve this and possible future problems is to uninstall your present python version and install Anaconda. With Anaconda package you get scipy, numpy, matplotlib and some others libraries for Python. Try it!

Related

Why python didn't see nltk module? [duplicate]

This question already has answers here:
How do I use installed packages in PyCharm?
(14 answers)
Closed 4 months ago.
I cant run my programm because nltk module is missing but i just intstalled it and it just right here in the folder
I tried to reinstall my python, and tried to change python interpreter but nothing worked
How have you actually installed nltk?
You can check if it's actually installed with pip freeze.
What might be happening here is that you could have another version of python installed, so make sure that you actually call the same interpreter for checking and installing with pip, in your case E:/pythonProject1/Scripts/python.exe -m pip freeze and E:/pythonProject1/Scripts/python.exe -m pip install nltk

Error trying to install matplotlib in Windows [duplicate]

This question already has answers here:
Cannot install Matplotlib on Python 3.10
(2 answers)
Closed 1 year ago.
I'm trying to install matplotlib for Python 3.10 in Windows. Im using pip: pip install matplotlib I've already installed NumPy, Cython, Pillow and other libraries needed. But it shows this error:
error: Failed to download any of the following: ['http://www.qhull.org/download/qhull-2020-src-8.0.2.tgz']. Please download one of these urls and extract it into 'build/' at the top-level of the source repository.
I've downloaded the said library and copied it in .cache/matplotlib/build but it doesnt work.
Any idea?
So as #FlyingTeller commented, there are no stable realeses of matplotlib so using --pre fixed the problem.

Problem installing PyQtChart module in python 3.7 [duplicate]

This question already has answers here:
Cannot import PyQtChart in Python 3.7
(2 answers)
Closed 2 years ago.
I am trying to install the PyQtChart module for embedded graphics in PyQt5, for this I do the traditional procedure:
windows + R
pip install PyQtChart
The problem is that when doing so, I get the following errors, and the module is not installed, attached image:
For my works I use the editor 'Spyder', which comes when I install anaconda.
If someone has had a similar problem or knows how to solve this type of problem, I would greatly appreciate it, kind regards.
You have to have the same version of PyQt5 and PyQtChart installed:
python -m pip install PyQt5==5.15 PyQtChart==5.15
Also, try to install from windows power shell(admin) mode
Verify that the version of PyQtChart is the same that PyQt5:
python -m pip install PyQt5==5.13 PyQtChart==5.13

How to use opencv module in python(I'm using pycharm) [duplicate]

This question already has answers here:
Cannot find module cv2 when using OpenCV
(24 answers)
Closed 2 years ago.
Thanks to read my question.
I got homework to print figures and try to use opencv module.
I search internet and download opencv by using cmd.(pip install opencv-python)
But in pycharm, I can't use opencv module.
Error massage tells me
ModuleNotFoundError: No module named 'cv2'
I don't know about programming well, It's hard to me guess reason.
Some theory is my code file is in D drive, not C drive which pycharm or python is install.
If you have python version 3 and above:
pip3 install opencv-python
If you have python version 2 and above:
pip install opencv-python
If you have used these commands and installed the package successfully, there is a good chance that your pycharm is not using the python version that you have installed this package on.
If you just want to be assured that you have installed the package correctly use
pip list
and check if the opencv-python is in the list. If you are seeing this package in the list you should check the version of your pycharm python interpreter.
Checkout this link for more information:
https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html

How do I install matplotlib on pyCharm [duplicate]

This question already has answers here:
Can't install matplotlib to pycharm
(3 answers)
Closed 2 years ago.
I'm new to python and I'm using PyCharm as my IDE. I've been able to successfully install other packages like numpy, pandas etc. However, when I'm installing matplotlib, I keep getting the error:
src/checkdep_freetype2.c(5): fatal error C1189: #error: "FreeType version 2.3 or higher is required. You may set the MPLLOCALFREETYPE environment variable to 1 to let Matplotlib download it."
I installed it through the command prompt and it installed correctly but (I believe) PyCharm creates it's own environment and does not recognize packages installed through command prompt even though I tried to install them in the same path as other packages in PyCharm. Can you please help?
I had to run the command "pip install updates" and after that I could install the matplotlib package. It turns out that my pip wasn't of the latest version.

Categories

Resources