So, I'm trying to install and use the google-images-download repo both through: pip install google-images-download and pip install git+https://github.com/Joeclinton1/google-images-download.git
I've tried installing it as SU as well. In PyCharm when I view packages I do see it but when I try this code:
from google_images_download import google_images_download
#instantiate the class
response = google_images_download.googleimagesdownload()
arguments = {"keywords":"aeroplane, school bus, dog in front of house",
"limit":10,"print_urls":False}
paths = response.download(arguments)
#print complete paths to the downloaded images
print(paths)
it gives this error continuously:
Traceback (most recent call last):
File "/Users/*x*/Desktop/SchoolPython/PythonUVA/Webscrape.py", line 1, in <module>
from google_images_download import google_images_download
ModuleNotFoundError: No module named 'google_images_download'
I think it might not be looking in the right filepath or library but any other repo I tried previously did work.
Any help is greatly appreciated.
*edit for versions
(3.9UVA) MacBook-Pro-van-Flavia:Webscrape.py flavia$ which pip
/Users/flavia/PycharmProjects/3.9UVA/bin/pip
(3.9UVA) MacBook-Pro-van-Flavia:Webscrape.py flavia$ which python
/Users/flavia/PycharmProjects/3.9UVA/bin/python
(3.9UVA) MacBook-Pro-van-Flavia:Webscrape.py flavia$ pip list
Package Version
---------------------- -----------
async-generator 1.10
attrs 21.4.0
certifi 2022.5.18.1
cffi 1.15.0
charset-normalizer 2.0.12
cryptography 37.0.2
google-images-download 2.8.0
h11 0.13.0
idna 3.3
outcome 1.1.0
Pillow 9.1.1
pip 21.3.1
pycparser 2.21
pyOpenSSL 22.0.0
PySocks 1.7.1
requests 2.27.1
selenium 4.2.0
setuptools 60.2.0
sniffio 1.2.0
sortedcontainers 2.4.0
trio 0.20.0
trio-websocket 0.9.2
urllib3 1.26.9
wheel 0.37.1
wsproto 1.1.0
Related
I am running EMR cluster(AWS) but I do not understand how notebook imports packages. I am running PySpark kernel.
import boto3
No module named 'boto3'
Traceback (most recent call last):
ModuleNotFoundError: No module named 'boto3'
print (sys.version) shows
3.7.6 (default, Feb 26 2020, 20:54:15)
[GCC 7.3.1 20180712 (Red Hat 7.3.1-6)]
print(sys.executable) shows
/tmp/1594625399736-0/bin/python
I have both Conda and pip3 install of boto3.
How to solve this?
Are you using pyspark? If yes, then you need to install the packages in the spark context. Refer to this AWS document: https://aws.amazon.com/blogs/big-data/install-python-libraries-on-a-running-cluster-with-emr-notebooks/
similarly install any dependency packages if you see module not found error on import. Make sure the versions are compatible.
sc.list_packages()
Package Version
-------------------------- -------
beautifulsoup4 4.9.0
boto 2.49.0
cycler 0.10.0
jmespath 0.9.5
kiwisolver 1.2.0
lxml 4.5.0
matplotlib 3.2.2
mysqlclient 1.4.2
nltk 3.4.5
nose 1.3.4
numpy 1.19.0
pandas 1.0.5
pip 9.0.1
py-dateutil 2.2
py4j 0.10.9
pyparsing 2.4.7
pyspark 3.0.0
python-dateutil 2.8.1
python37-sagemaker-pyspark 1.3.0
pytz 2020.1
PyYAML 5.3.1
setuptools 28.8.0
six 1.15.0
soupsieve 1.9.5
wheel 0.29.0
windmill 1.6
I have boto.
sc.install_pypi_package("boto3")
I have to run a python 3 script on a centos 7 host. I've installed python3.8 side by side with python2 so it doesn't break yum.
When I'm running the script I need to run I get this error:
Traceback (most recent call last):
File "A2PTestSuit.py", line 8, in <module>
import pandas as pd
File "/usr/local/lib/python3.8/site-packages/pandas/__init__.py", line 16, in <module>
raise ImportError(
ImportError: Unable to import required dependencies:
numpy: No module named '_ctypes'
If I list the modules I see that pandas and numpy are installed:
python3 -m pip list
Package Version
--------------- ----------
certifi 2019.11.28
chardet 3.0.4
DateTime 4.3
idna 2.8
numpy 1.18.1
pandas 0.25.3
pip 19.3.1
python-dateutil 2.8.1
pytz 2019.3
requests 2.22.0
setuptools 41.2.0
six 1.13.0
urllib3 1.25.7
zope.interface 4.7.1
How can I get past this error?
You can try updating all of your packages in the command line using pip, or just use try: import ... except ImportError: continue
I've got same issue. Problem was solved after I change default interpreter (which was Python 3.8) in PyCharm
I am writing a script that simply asks the google api for the latitudes and longitudes for a list of addresses read in from a csv file and outputs an html with the googlemap widget embedded. Further I hoped to run pyinstaller in order to make this into a .exe.
Running the code on my original conda environment it works fine however the .exe that pyinstaller creates is massive for such a small script (over 300mb). As such, I created a new virtual environment in which to work and have installed what I believe to be the bare minimum packages necessary and have rewritten the code to use as few packages as I am able which for the currently working portion of the code dropped it down considerably to just over 10 mb. (No numpy or pandas for me... ah well).
The code again works fine up until the final step:
from ipywidgets.embed import embed_minimal_html
embed_minimal_html("exporttest.html", None)
The above line should take any widgets, in particular the figure created from
fig = gmaps.figure(layout=figure_layout)
markers = gmaps.marker_layer(coordinates)
fig.add_layer(markers)
fig
Running the currently modified version in my original conda environment with all my of my usual packages installed this runs as expected without errors. Running on the virtual environment however on the mentioned lines I get the following key error:
KeyError Traceback (most recent call last)
c:\programdata\anaconda3\envs\synod_environ\lib\sre_parse.py in
parse_template(source, pattern)
1020 try:
-> 1021 this = chr(ESCAPES[this][1])
1022 except KeyError:
KeyError: '\\u'
During handling of the above exception, another exception occurred:
error Traceback (most recent call last)
<ipython-input-5-3359941239ab> in <module>
1 from ipywidgets.embed import embed_minimal_html
2
----> 3 embed_minimal_html("exporttest.html", None)
...
error: bad escape \u at position 0
(For clarification, key error has two slashes before the u, some frustration in getting this to post correctly)
As the code runs correctly in the one environment but not the other, I can only assume that I'm missing a package somewhere that ipywidgets requires, but running pip check doesn't notify me of anything missing.
pip list returns the following packages:
altgraph 0.16.1
backcall 0.1.0
bleach 3.0.2
certifi 2018.10.15
chardet 3.0.4
colorama 0.4.0
decorator 4.3.0
defusedxml 0.5.0
entrypoints 0.2.3
future 0.17.1
geojson 2.4.1
gmaps 0.8.2
idna 2.7
ipykernel 5.1.0
ipython 7.1.1
ipython-genutils 0.2.0
ipywidgets 7.4.2
jedi 0.13.1
Jinja2 2.10
jsonschema 2.6.0
jupyter 1.0.0
jupyter-client 5.2.3
jupyter-console 6.0.0
jupyter-core 4.4.0
macholib 1.11
MarkupSafe 1.0
mistune 0.8.4
nbconvert 5.4.0
nbformat 4.4.0
notebook 5.7.0
pandocfilters 1.4.2
parso 0.3.1
pefile 2018.8.8
pickleshare 0.7.5
pip 10.0.1
prometheus-client 0.4.2
prompt-toolkit 2.0.7
Pygments 2.2.0
PyInstaller 3.4
python-dateutil 2.7.5
pywin32-ctypes 0.2.0
pywinpty 0.5.4
pyzmq 17.1.2
qtconsole 4.4.2
requests 2.20.0
Send2Trash 1.5.0
setuptools 40.4.3
six 1.11.0
terminado 0.8.1
testpath 0.4.2
tornado 5.1.1
traitlets 4.3.2
urllib3 1.24
wcwidth 0.1.7
webencodings 0.5.1
wheel 0.32.2
widgetsnbextension 3.4.2
wincertstore 0.2
Any thoughts on how to further identify what went wrong, what package might be missing or how to fix the issue, and/or alternate ways to save a googlemaps output?
Fiddling with it and comparing from one environment to the other, I found that my virtual environment had ipywidgets 7.4.2 while the base environment had ipywidgets 7.2.1. Downgrading versions fixed the issue I was having.
I am running from a batch file that basically runs the robot.bat command.
Any suggestion on why would that be an issue and how to solve it? I see the packages are installed correctly. This is the first time I am attempting to run a test.
$ ./bin/run-windows.bat
>C:\Users\kondalar\workspace\rafa\cra-ui-qa>robot.bat --pythonpath C:/Users/kondalar/apps/conda/envs/robot-cray-ui-test2 --critical Critical --outputdir ..\report --variablefile C:/Users/kondalar/workspace/rafa/cra-ui-qa/config/windows-local-config.py C:/Users/kondalar/workspace/rafa/cra-ui-qa/cases/01*
[ ERROR ] Error in file 'C:\Users\kondalar\workspace\rafa\cra-ui-qa\resources\project-import.robot': Importing test library 'C:/Users/kondalar/apps/conda/envs/robot-cray-ui-test2/Lib/site-packages/ExtendedSelenium2Library' failed: ImportError: No module named keywords
Traceback (most recent call last):
File "C:\Users\kondalar\apps\conda\envs\robot-cray-ui-test2\Lib\site-packages\ExtendedSelenium2Library\__init__.py", line 27, in <module>
from ExtendedSelenium2Library.keywords import ExtendedElementKeywords
File "C:\Users\kondalar\apps\conda\envs\robot-cray-ui-test2\Lib\site-packages\ExtendedSelenium2Library\keywords\__init__.py", line 24, in <module>
from ExtendedSelenium2Library.keywords.extendedelement import ExtendedElementKeywords
File "C:\Users\kondalar\apps\conda\envs\robot-cray-ui-test2\Lib\site-packages\ExtendedSelenium2Library\keywords\extendedelement.py", line 27, in <module>
from Selenium2Library.keywords import _ElementKeywords
PYTHONPATH:
C:\Users\kondalar\apps\conda\envs\robot-cray-ui-test2
C:\Users\kondalar\apps\conda\envs\robot-cray-ui-test2
C:\Users\kondalar\apps\conda\envs\robot-ui-test\python27.zip
C:\Users\kondalar\apps\conda\envs\robot-ui-test\DLLs
C:\Users\kondalar\apps\conda\envs\robot-ui-test\lib
C:\Users\kondalar\apps\conda\envs\robot-ui-test\lib\plat-win
C:\Users\kondalar\apps\conda\envs\robot-ui-test\lib\lib-tk
C:\Users\kondalar\apps\conda\envs\robot-ui-test
C:\Users\kondalar\apps\conda\envs\robot-ui-test\lib\site-packages
$ conda list
>packages in environment at C:\Users\kondalar\apps\conda\envs\robot-cray-ui-test2:
certifi 2017.11.5 py27h03b45e1_0
chardet 3.0.4 <pip>
coverage 4.4.2 <pip>
decorator 4.1.2 <pip>
idna 2.6 <pip>
jsonpath-rw 1.4.0 <pip>
jsonpath-rw-ext 1.1.3 <pip>
pbr 3.1.1 <pip>
pip 9.0.1 py27hdaa76b4_4
pluggy 0.6.0 <pip>
ply 3.10 <pip>
py 1.5.2 <pip>
python 2.7.13 h1b6d89f_16
requests 2.18.4 <pip>
robotframework 3.0.2 <pip>
robotframework-databaselibrary 1.0.1 <pip>
robotframework-debuglibrary 0.8.1 <pip>
robotframework-extendedselenium2library 0.9.1 <pip>
robotframework-jsonlibrary 0.2 <pip>
robotframework-requests 0.4.7 <pip>
robotframework-selenium2library 3.0.0 <pip>
robotframework-seleniumlibrary 3.0.0 <pip>
selenium 3.8.0 <pip>
ExtendedSelenium2Library doesn't support SeleniumLibrary version 3. It's trying to import things that are in Selenium2Library which no longer exists with version 3.
I am using conda virtual environment and I have intsalled the lxml module using conda install lxml. The package was successfully installed but when I open python in my terminal and do import lxml, I get the following error:
`>>> import lxml
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'lxml'
`
I don't understand what is the issue here.
My installed packages are as follows:
`# packages in environment at /users/deepayan/miniconda3/envs/pytorch:
#
hdf5 1.8.17 1
jbig 2.1 0
jpeg 8d 2
libiconv 1.14 0 anaconda
libpng 1.6.27 0
libtiff 4.0.6 2
libxml2 2.9.4 0 anaconda
libxslt 1.1.29 0 anaconda
lxml 3.8.0 py36_0
mkl 2017.0.1 0
numpy 1.12.1 py36_0
opencv 3.1.0 np112py36_1
openssl 1.0.2l 0
pip 9.0.1 py36_1
python 3.6.1 2
readline 6.2 2
setuptools 27.2.0 py36_0
sqlite 3.13.0 0
tk 8.5.18 0
wheel 0.29.0 py36_0
xz 5.2.2 1
zlib 1.2.8 3
`
All other packages can be imported error free, the problem is only with lxml. If anyone can suggest a way out, I'd be very grateful.
Thanks