After using pip install sas7bdat and getting a Successfully installed sas7bdat-2.2.3
I still get No module named 'sas7bdat' for sas7bdat when I import sas7bdat
Related
I am trying capture text file from image and I am referring to this link https://www.simplifiedpython.net/how-to-extract-text-from-image-in-python/
So far I already done installing the pytesseract and Image library using this command:
pip install Image
pip install pytesseract
Already done downloading and install the PIL-1.1.7.win32-py2.7.exe
I tried now to run this on my script but still got error:
import pytesseract
try:
from PIL import Image
except ImportError:
import Image
Here is my error:
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
Original error was: DLL load failed: %1 is not a valid Win32 application.
Anyone know if there any prerequisites that I am missing now. TIA
I just reinstall the numpy and error got solve.
When I am running
from docx import Document
I am getting error as
ImportError: cannot import name Document
I am working on Python 2.7.
It looks like you have installed only docx, but I tried with this and worked for me:
pip uninstall docx
pip install python-docx
This way you will be using the newest version of the library, hope you find it useful.
Summary
I'm looking for a way to find all of the required pip install statements, with version numbers, based upon the import statements used in a script. I'll use the results to create a requirements.txt file for the environment configuration during deployment.
Issues
There is a deviation between the import name in python and the package name used by pip. Also, when using sub modules, its not immediately apparent that a pip install of the parent would be required. For instance, in our script we're doing:
import pandas as pd
#body of code
writer = pd.ExcelWriter(filename, engine='xlsxwriter')
So, if we just pip install pandas, we'll get an error that xlsxwriter needs to be installed as well.
Attempts and Research
First Attempt
#Import Packages
import pandas as pd
from sklearn import linear_model
#Create an Array of the Package names
imports = ['pandas','sklearn']
#find installed package version on local machine for each imported package
import pip #needed to use the pip functions
for i in pip.get_installed_distributions(local_only=True):
for ii in imports:
if str(i).find(str(ii)) != -1:
print(str(i))
#pandas 0.18.1 is found but scikit-learn 0.17.1 is not
Research
The below from an SO post appears to list out all of the import names, but they after running the second answer in the post, the import names I would expect to see such as 'sklearn' were missing.
print(list(item[1] for item in pkgutil.iter_modules()))
When i am trying run a python script with following code
from robobrowser import RoboBrowser
I have got following error:
from robobrowser import RoboBrowser
ImportError: No module named robobrowser
This usually happens when the library was not installed correctly, make sure you have installed it.
Python robobrowser 0.5.3
It's easy to install, go to your terminal and type easy_install robobrowser or if you have installed pip then you can also install by doing pip install robobrowser
Requirements: python >= 2.6
I just installed django-stdimage with easy_install on my server.
It told it me installed successfully at /home/myuser/lib/python2.4/django_stdimage-0.2.2-py2.4.egg
How do I import stdimage with django to start using it?
Found the answer. Easy_install's .egg files are just .zip files. I unzipped the file where it was installed and then imported the module:
from stdimage import StdImageField