I am trying to use the lichess python API, but I cannot import it into python. I used the pip command and made sure it was updated and various other attempts, but it still gives me the error that says 'no module named 'lichess''
import lichess.api
user = lichess.api.user('thibault')
print(user['perfs']['blitz']['rating'])
command line output when I type pip install python-lichess: https://pastebin.com/1LmXJtcB
Related
I was going through an Reinforcement Learning Course and wanted to try running the code locally. I installed RLGlue with pip install rlglue from here
But then when trying to run the code:
from rlglue.rl_glue import RLGlue
import main_agent
import ten_arm_env
import test_env
Received this error message:
ModuleNotFoundError: No module named 'rlglue.rl_glue'
Any idea on how to fix that to import the module?
I use this as work-around, add this file to your project.
https://gist.github.com/niektuytel/eab1117070454042b11e5e5c026dd3fb
I am using Pillow-6.1.0 for my python project and I am trying to import the ImageGrab() function inside it however I keep getting this following error:
cannot import name '_imaging' from 'PIL'
I am currently using Python 3.7 and editing the code on Visual Studios (Unsure if the IDE may play part in the error as I do not have much experience on it)
I am also running Windows so some of the solutions I have seen which require Linux does not work for me.
What I have tried:
Uninstalling and reinstalling Pillow
Deleting everything with "PIL" in the Python37-32/Lib/site-packages folder and uninstalling Pillow and reinstalling
Moving the Pillow module directly into my project folder
Moving ImageGrab.py directly into my project folder
Updated my Pillow module
All my reinstallations of Pillow is via the pip command
Other possibly relevant info:
ImageGrab() is not the only module that I cant import, I also cant import the Image module
I can import the PIL module successfully but I cannot access the modules within it via the command "from PIL import some_PIL_module" in my IDE
I only get the "cannot import name '_imaging' from 'PIL'" error when I am running my code through the Visual Studios IDE, if I type the command "from PIL import ImageGrab" directly into the python terminal it runs successfully with no errors
This is the line that gives me the error in my code
from PIL import ImageGrab;
I expected it to import with no problems but instead, I get the following error:
cannot import name '_imaging' from 'PIL'
I have a python file and the developer of that code has left the organization. When I run the code I get the following error.
import dataAnalysis as DV ModuleNotFoundError: No module named
'dataAnalysis'
I provide below the brief snippet of the python file "main.py" below.
import dataAnalysis as DV
def performCheck():
... other code
... other code
i = DV.addGraph( pathplus)
Here my question is , how to know the actual module or package name of "dataAnalysis" from the above import statement so that I can make "pip install ". However, I tried to install DataAnalysis module, still it does not work.
Is there any way to get the module or package name to install from the import statement in python ?
Go to console or terminal and run command pip install dataAnalysis. If permission denied, then make sure you have enough privilege to install a package.
Update:
In my opinion pip package DataAnalysis is a library that can be used for pre-processing a csv file. As per your given code, it looks like adding a graph so may be it could be a local package. Check dataAnalysis folder in your project with __init__.py file inside.
I tried using the following command to import tweepy in my system into the folder- c/python27/Scripts/tweepy :
git clone https://github.com/tweepy/tweepy.git
cd tweepy
python setup.py install
But, when i tried to import tweepy and use it in my program, i'm still getting error as:
"No module named tweepy"
My programs are in c:/Users/xxxx/.spyder-py3/, what else should i do to correct this error.
I recently tried to view Google Calendar using python . To do that I referred Python Quickstart. I did the steps that were mentioned in the website.
I completed the second step and downloaded the secretclient.json file.
In the terminal I typed in :
pip install --upgrade google-api-python-client
as I was instructed in the website.
I ran the python that was on the website and when I compiled I got the error:
Blockquote
Traceback (most recent call last):
File "quickstart.py", line 2, in
from apiclient import discovery
ModuleNotFoundError: No module named 'apiclient'
The Lines which correspond to the error are :
from apiclient import discovery
Why is the apiclient module unavailable ?
Could it be that you're using a different python version than what the pip installed? For example, if you use python3 to execute the problematic import line, but pip is for python2. Or if you use conda or another python distribution that uses a different path to import the packages from.
You can verify it if you just open from the command line:
python
then
from apiclient import discovery
and check if you still get the error.
you can resolve this by going to Script folder of your Python installation directory and running from there
e.g.
cd D:\Python27\Scripts\
python
from apiclient import discovery
Mainly this issue arises when u have more than one python installation , as noob have suggested