Cannot reinstalling igraph - python

I installed igraph on my windows server using pip:
pip install python_igraph-0.7.1.post6-cp37-cp37m-win_amd64.whl
After its installation, I could not import it into Spyder (AttributeError: 'module' object has no attribute 'Graph') but I could import and use it in Jupyter Notebook...!!!!
After running some analysis with my graph I wanted to draw it, so I searched trough the net and found this link :
So I thought I should install "cairocffi" and installed it:
pip install cairocffi
After installing "cairocffi", I couldn't neither draw my graph, nor my igraph package works anymore.
when I imported the igraph again I got the below error:
I tried uninstalling the igraph, so that I could install it again, but the above error is still there.
So I searched the net to see whether I can download those specified libraries, but found nothing. what should I do?

Related

Python Error ModuleNotFoundError: No module named 'transformers'

I'm getting below error when running 'import transformers', even though I have installed in the same vitual env. I'm using python 3.8
ModuleNotFoundError: No module named 'transformers'
Error:
enter image description here
I have uninstalled it and reinstalled it using 'pip3 install transformers' from python cmd line.
Then I tried to uninstalled again, and reinstalled in jupyter notebook using '!pip install transformers', result shows '
Installing collected packages: transformers
Successfully installed transformers-4.24.0
'
I can also verify directly in Jupyter Notebook:
enter image description here
I tried to install transformers successfully in jupyter Notebook. After that still getting ModuleNotFoundError error (have tried restarted kernel too)
enter image description here
its resolved now. I just tried to use %pip install transformers==3.4.0, instead of !pip install transformers==3.4.0 in jupyter book, and it worked. I can proceed with the project for now. Although I don't know what I did wrong in my python command line earlier that caused the inconsistency. Will open a new thread.

Cannot import opencv because of circular import

When trying to import opencv in jupyter lab notebook (import cv2) i get this error:
AttributeError: partially initialized module 'cv2' has no attribute
'gapi_wip_gst_GStreamerPipeline' (most likely due to a circular
import)
I have tried installing opencv both via pip:
pip install opencv-python
than via conda-forge:
conda install -c conda-forge opencv
in different envs, also uninstalling and reinstalling.
If i try to import it via command line python i do not get any error.
I came up with a dirty fix, for the ones that are in a rush.
The error is produced by the last line (290) of the file: /.local/lib/python3.8/site-packages/cv2/gapi/__init__.py:
cv.gapi.wip.GStreamerPipeline = cv.gapi_wip_gst_GStreamerPipeline
That seems like some sort of naming adjustment. I commented out the line and the import error is gone and the library seems to work ok.

Importing matplotlib returns "ModuleNotFoundError" after installing matplotlib with pip

I'm trying to display data using a pie chart in python, so i tried to install matplotlib using pip. After doing that, I tried importing matplotlib but I get an error: ModuleNotFoundError: No module named 'matplotlib'.
In the Command Prompt I typed 'pip install matplotlib' and everything appeared to be successful. This is the last line:
Successfully installed backports.functools-lru-cache-1.5 cycler-0.10.0 kiwisolver-1.0.1 matplotlib-2.2.4 numpy-1.16.2 pyparsing-2.3.1 python-dateutil-2.8.0 pytz-2018.9 six-1.12.0
I've also tried 'python -m pip install -U matplotlib', but I still get a ModuleNotFoundError.
I've tried running the input statement in both python 3 and 2, neither worked.
I've looked at various different discussions on this, and none of them seemed to help me. How can I fix this?
There are various python installed in your OS. If you install matplotlib for somewhere the python that you are using does not search, you get importing errors. You should figure out which python you want to use and where the packages it searches.
check your python path. the matplotlib should be installed in the same path with your python environment.
I guess you use an IDE to run the python. some IDE have their own python environment.
if not solved. plz introduce some details about your system、how installed etc.

Installing pylab on Mac OSX

I've looked at many questions on this issue, but none seem to help. I am new to Python and programming. I am not sure if installing matplotlib is what I need to do, but it was the link given in my textbook (I am self studying, so there's no one I can ask).
I downloaded the newest version of Python, 2.7.10, and then went to here and followed the instructions.
In Terminal.app,
Installing collected packages: pip, wheel
Found existing installation: pip 6.1.1
Uninstalling pip-6.1.1:
Successfully uninstalled pip-6.1.1
Successfully installed pip-7.0.1 wheel-0.24.0
Yet when I run my code, which begins with:
import pylab
from rcParamsSettings import *
import random
I end up getting
ImportError: No module named pylab
Can someone please help me figure this out? I have no idea what to do now.
It looks like you ran the instructions to (re)install pip, but you did not yet run the instruction that uses pip to install matplotlib, i.e.:
pip install matplotlib

Trouble installing scikit-learn on Windows 7 machine

I installed sci-kit learn with the installer scikit-learn-0.13.1.win32-py2.7.exe but when I try to call it in Canopy and iPython I get the following error: "ImportError: No module named sklearn".
I tried the following solutions found online but non of them work
Running python setup.py install in the directory and got this error: "ImportError: no module named sklearn._build_utils"
Tried pip install - U scikit-learn but the download keeping on timing out
Tried easy_install - U scikit-learn but the download also kept on timing out
I'm wondering if it is because I am using Canopy (Free version) and I should maybe uninstall it and install all my packages again using vanilla Python.
Thanks.
Have you tried adding sklearn to your python path manually? Have a look at this thread, it might help!
How to add to the pythonpath in windows 7?

Categories