I am using django-address in a Django 1.7 project and I get an ImportError whenever I try to create an object containing at least one AddressField.
The traceback says
cannot import name GoogleMapsError
The exception is thrown by this particular import statement:
from googlemaps import GoogleMapsError
I tried to manually install googlemaps from pip but it did not help because GoogleMapsError could not be found in the module. The instructions from django-address do not mention any explicit dependency so I'm a bit confused.
Any advice on this?
Looks like django-address code was based on:
http://sourceforge.net/p/py-googlemaps/code/HEAD/tree/trunk/googlemaps/googlemaps.py
(which it seems you'd get by pip install googlemaps==1.0.2 https://pypi.python.org/pypi/googlemaps/1.0.2)
However there is a newer version of googlemaps https://pypi.python.org/pypi/googlemaps/2.0 which is what you'd get if you just pip install googlemaps now... and this has different code:
https://github.com/googlemaps/google-maps-services-python
So, I believe that pip install googlemaps==1.0.2 should fix your problem.
Actually that reference to GoogleMapsError is from an older version of django-address and is now unused. I've removed it from the code and, consequently, the dependence on py-googlemaps. Please try reinstalling the latest version of django-address from the Github repository. Thanks!
Related
I am fairly new to TensorFlow and just installed it with CPU-support-only version following to this: https://www.tensorflow.org/install/install_linux
My Ubuntu is 16.04 and python installed is 2.7.13. I chose "native" pip installation.
The download and install process went though smoothly, however, when I tried to import Tensorflow and use it, it returns following error;
ImportError: /usr/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so: undefined symbol: PyUnicodeUCS4_FromString
I have got no clue how to solve it after crawling in google.
If you know some idea on how to solve this and could give me some advice, much appreciated.
Thank you so much in advance!
It's because your python is built with UCS2, which is incompatible with the one assumed by tensorflow (UCS4). So either you build your python with UCS4 (--enable-unicode=ucs4) or build tensorflow from source may solve this issue, I guess.
I am working on ubuntu 14.04. Python version: 2.7.6.
I am trying to install cPickle, but I am getting error:
"could not find any downloads that satisfy the requirement cPickle"
I tried via, pip and apt-get as well. What might be reason, has this package been removed completely?
Actually, I tried importing cPickle and it worked. But I don't know why the error "could not find any downloads that satisfy the requirement cPickle". I will appreciate if someone can provide reason.
Also as commented by mike cleared my doubt.
"cPickle is installed when python itself is installed -- it's part of the standard library. So, just import cPickle and it should be there"
I downloaded scipy-0.17.0-cp27-none-win_amd64.whl and GDAL-1.11.4-cp27-none-win_amd64.whl from gohlke in C:\Python27\Scripts
To install I used
pip install scipy-0.17.0-cp27-none-win_amd64.whl
pip install GDAL-1.11.4-cp27-none-win_amd64.whl
It says the installation is complete but when I import the libraries as
import scipy
import gdal
it shows error as
No module named gdal
No module named gdal
However, I installed the matplotlib, numpy in the very same way and they are working absolutely fine.
I solved this problem eventually to found the mistake in my approach.
This problem can occur with anyone using ArcGIS in one's system.
ArcGIS comes with it's default Python package and if one installs python separately, each time the new libraries gets installed in the newer Python installation not in ArcGIS.
Therefore, the pyhton IDLE which one uses need to be from another Python installation.
Here in my case, ArcGIS has Python 2.6 and I have made an separate installation using Python 2.7.11.
All the libraries were getting installed in right place but I was opening the wrong IDLE to write scripts hence getting error.
I recently downloaded the xlsxwriter version 0.6.4 and installed it on my computer. It correctly added it to my C:\Python27\Lib\site-packages\xlsxwriter folder, however when I try to import it I get the error ImportError: No module named xlsxwriter. The traceback is File "F:\Working\ArcGIS\ArcGIS .py\Scripts\Append_Geodatabase.py".
However if I try to import numpy (I can't remember what numby is, however it is located in the same site-packages folder C:\Python27\Lib\site-packages\numpy) it has no problem.
Any idea of what could be causing this issue?
Thanks for the help.
Here are some easy way to get you up and running with the XlsxWriter module.The first step is to install the XlsxWriter module.The pip installer is the preferred method for installing Python modules from PyPI, the Python Package Index:
sudo pip install xlsxwriter
Note
Windows users can omit sudo at the start of the command.
Even if it looks like the module is installed, as far as Python is concerned it isn't since it throws that exception.
Try installing the module again using one of the installation methods shown in the XlsxWriter docs and look out for any installation errors.
If there are none then run a sample program like the following:
import xlsxwriter
workbook = xlsxwriter.Workbook('hello.xlsx')
worksheet = workbook.add_worksheet()
worksheet.write('A1', 'Hello world')
workbook.close()
I have the same issue. It seems that pip is the problem. Try
pip uninstall xlsxwriter
easy_install xlsxwriter
I managed to resolve this issue as follows...
Be careful, make sure you understand the IDE you're using! - Because I didn't.
I was trying to import xlsxwriter using PyCharm and was returning this error.
Assuming you have already attempted the pip installation (sudo pip install xlsxwriter) via your cmd prompt, try using another IDE e.g. Geany - & import xlsxwriter.
I tried this and Geany was importing the library fine. I opened PyCharm and navigated to 'File>Settings>Project:>Project Interpreter' xlslwriter was listed though intriguingly I couldn't import it! I double clicked xlsxwriter and hit 'install Package'... And thats it! It worked!
Hope this helps...
sudo pip install XlsxWriter
Make sure that X and W are in uppercase.
I am not sure what caused this but it went all well once I changed the path name from Lib into lib and I was finally able to make it work.
I installed it by using a wheel file that can be found at this location:
https://pypi.org/project/XlsxWriter/#files
I then ran pip install "XlsxWriter-1.2.8-py2.py3-none-any.whl"
Processing ./XlsxWriter-1.2.8-py2.py3-none-any.whl
Installing collected packages: XlsxWriter
Successfully installed XlsxWriter-1.2.8
in VSCode:
instead of activating your environment with script use python select interpreter
from VSCode(press ctrl + shift + p)
and then select your environment from the list (marked with recommended)
I found the same error when using xlsxwriter in my test.py application. First, check if you have xlsxwriter module installed or not.
sudo pip install xlsxwriter
Then check the python version you are using, The following worked for me
python2 test.py
Using this on Raspberry Pi 4. I had a similar issue. I followed the install step:
sudo pip install xlsxwriter
None of the IDEs could find the module. I had to use Add/Remove Software under preferences in the GUI, search for xlsxwriter, select one by clicking on it and make sure the box is checked, and then click apply, then select the other one (it showed two for me) and click apply for that one. After that, it worked fine.
I have used Scipy for some time. This is the first time I am using it for Signal processing!
But when I import modules like
from scipy import signal
from scipy import special
I get the error:
ImportError: DLL load failed: The specified module could not be found.
I am using Python 2.7.3 with Scipy 0.12.0 on 32-Bit Windows.
What should I do ?
This problem can be solved if instead of installing the usual numpy distribution, the numpy-MKL package is installed.
This package is available here.
Do remove the previous installation before going with the new one!
I already had numpy+mkl installed, but still I faced similar error.
Reinstalling has solved the issue:
pip uninstall numpy-1.13.1+mkl-cp35-cp35m-win_amd64.whl
pip install numpy-1.13.1+mkl-cp35-cp35m-win_amd64.whl
I installed numpy-MKL from here for Python 3.5.1, but it didn't solve the problem until I added the folder C:\Program Files\Python35\Lib\site-packages\numpy\core to system path.
Similar to the OP, I already had the Intel MKL libraries installed on my system. I was unable to load scipy.linalg with the same error message. I uninstalled the old version of numpy and scipy (which I installed before installing the Intel compilers and math libraries). Then ran pip install scipy, and magically I could now import scipy.linalg without the error.
I'm not entirely sure what caused it, and why it was unable to find the library it needed. But it somehow fixed the problem for me on Python 3.7.1 with Anaconda.
I had an issue importing sklearn because of my Scipy installation.
I fixed this by going to here and downloading the right version of numpy for my computer. Then I did the same for Scipy by going here and downloading the MKL version for my computer.
Once I did that, everything worked!
To check the supported tags for wheel version for your system you can run the following command in the command prompt: pip debug --verbose.
You can install the .whl files for numpy and scipy by doing: pip install {filename}.whl
I had this issue on 3.6 and reinstalling didn't work,downloading the wheel didn't work. I found a solution that did work:
go to "site-packages/scipy" folder and open __init__.py file for editting.
At the very bottom add this line of code:
from . import signal
from . import special
from . import linalg
from . import <insert missing submodule here>
this is the only solution that has worked for me and it should work for any one