I am trying to run this project from github, https://github.com/adobe/pdfservices-extract-python-sdk-samples
i downloaded the project.
got the credentials
ran the pdfservices-extract-sdk==1.0.0b1 api and dependencies
now i am trying to call the program extract_txt_from_pdf.py to convert pdf to document, i got the following error
Traceback (most recent call last):
File "extract_txt_from_pdf.py", line 35, in
from adobe.pdfservices.operation.auth.credentials import Credentials
ModuleNotFoundError: No module named 'adobe'
Thanks in advance for your help.
As I found, you will need to pre-install the below module separately to properly install pdfservices-sdk module in your system.
FYI: Minimum requirement is python 3.6 as of today
pip3 install Sphinx
Cheers!
Per the instructions here, you need to:
Extract the downloaded samples .zip.
From the samples root directory, run pip install -r requirements.txt.
Test the sample code on the command line.
Related
I'm trying to use w3af to start doing some routine security testing on a webapp that I'm using. Install instructions recommend cloning a git repo, then running the python code and seeing what dependencies are unmet then installing them. My first run yielded:
ModuleNotFoundError: No module named 'ConfigParser
OK, no problem, right?
$ pip install ConfigParser
Collecting ConfigParser
Downloading configparser-5.2.0-py3-none-any.whl (19 kB)
Installing collected packages: ConfigParser
Successfully installed ConfigParser-5.2.0
Mission accomplished, let's try again!
$ ./w3af_console
Traceback (most recent call last):
File "./w3af_console", line 12, in <module>
from w3af.core.controllers.dependency_check.dependency_check import dependency_check
File "/Users/westonx/bin/w3af/w3af/core/controllers/dependency_check/dependency_check.py", line 26, in <module>
from w3af.core.data.db.startup_cfg import StartUpConfig
File "/Users/westonx/bin/w3af/w3af/core/data/db/startup_cfg.py", line 22, in <module>
import ConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
Hmmm. Could swear we took care of that. Let's run pip (maybe pip3?) again to be sure?
$ pip3 install ConfigParser
Requirement already satisfied: ConfigParser in /Users/westonx/.pyenv/versions/3.8.2/lib/python3.8/site-packages (5.2.0)
Seems good. Let's check to see if the import path includes that directory:
$ python -c "import sys; print('\n'.join(sys.path)); import ConfigParser;"
/Users/westonx/.pyenv/versions/3.8.2/lib/python38.zip
/Users/westonx/.pyenv/versions/3.8.2/lib/python3.8
/Users/westonx/.pyenv/versions/3.8.2/lib/python3.8/lib-dynload
/Users/westonx/.pyenv/versions/3.8.2/lib/python3.8/site-packages
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'ConfigParser'
So... we know the sys.path includes the directory pip says the module is installed in, but when we import it, python insists it's not there.
configparser-5.2.0.dist-info and configparser.py are indeed in my ~/.pyenv/versions/3.8.2/lib/python3.8/site-packages directory, so it doesn't look like pip telling me something that's not true. But it sure looks like python is.
I'm using pyenv on MacOS 10.14, not sure if that makes a difference. Anyone have ideas of what next steps should be?
ConfigParser is a built in library in Python, but its name was changed to configparser in Python 3. It appears like w3af is still using Python 2 (I found this check that actively states it, but you never even got that far). So, to run this code, you need to run it with Python 2.
There are very many (thousands) of python3 compatibility issues with the w3af codebase. The ConfigParser issue is just the first one you hit - the codebase is full of references to outdated / unmaintained libraries, and has no support for python3 byte strings vs. unicode strings (b"" vs ""), which are used throughout the codebase.
There is a w4af project on Github, where someone has made the effort to port all the w3af code to python3, but you didn't hear that from me.
I have a Colab notebook open and have my files cloned from a github repo. I want to run a python script called models.py. In this file, I am using pandas. When I run this line in Colab:
!python3 models.py
I get the following error:
Traceback (most recent call last):
File "models.py", line 1, in <module>
import pandas as pd
ModuleNotFoundError: No module named 'pandas'
However, if I run in a cell on Google Colab:
!pip3 list
I find that pandas is indeed installed:
pandas 0.25.3
My assumption is that when I run the script, it is not able to see the libraries I have installed but I am unsure how to fix this issue.
If I run:
!which python3
I get:
/usr/local/bin/python3
The python file I am trying to run is under:
/content/my_project/models.py
Should I instead take a different approach to running this file?
Instead of
!python3 models.py
You can use
%run models.py
In a clean Colab runtime, the location of python 3 is different than what you show in your question:
!which python3
# /usr/bin/python3
It looks like you are installing another Python instance in your VM. To ensure you're using Colab's bundled Python 3 executable, try using
!/usr/bin/python3 models.py
If you actually want to use the new python instance you've installed, you'll have to also install whatever packages you need. For example
!/usr/local/bin/python3 -m pip install pandas
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
I know this is not an actual info-sec question, but I am having problems with getting the smbrealyx.py module to work. For some reason I get the following error when I try to execute the aforementioned python program.
Traceback (most recent call last):
File "smbrelayx.py", line 43, in <module>
from impacket import smbserver, smb, ntlm, dcerpc, version
File "/usr/lib/python2.7/dist-packages/impacket/smbserver.py", line 18, in <module>
from impacket import smbserver, version
ImportError: cannot import name smbserver
I am not familiar with python programming and I was hoping someone could help me fix this issue.
Looks like you have an old impacket version installed and you are using a newer version of smbrelayx.py.
First of it'd be great to know what version you have. You can easily do that by typing inside a Python interpreter the following:
from impacket import version
print version.BANNER
Assuming you have an old version, first of all it'd be great to remove the existing version. Depending on your Unix distro it might be just as easy as to remove the python-impacket package, or you can manually remove the library files by getting to know where those files are located:
import impacket
print impacket.__file__
That will give you the path where the library is installed. I'd suggest to remove the entire directory.
Now that your system is clean, you have two options:
Install a stable version: Grab the latest stable version from here. Uncompress it in a temp directory and then run:
python setup.py install
That will install the libraries and example scripts (e.g. smbrelayx.py)
Install the development version: You will need to git clone the development version first by running:
git clone https://github.com/CoreSecurity/impacket
Once the repo is cloned, inside the impacket directory type:
python setup.py install
That will install the libraries and example scripts (e.g. smbrelayx.py)
I installed oauth2:
$ pip install oauth2
But running the python-oauth2/example/client.py returns:
Traceback (most recent call last):
File "client.py", line 31, in <module>
import oauth.oauth as oauth
ImportError: No module named oauth.oauth
I tested pip freeze:
oauth2==1.5.211
Thanks in advance
As it turns out, the example directory in the oauth2 package should be ignored. It is broken code as far as the package is concerned.
See these issues for examples of other people discovering this:
https://github.com/simplegeo/python-oauth2/issues/33
https://github.com/simplegeo/python-oauth2/issues/12
https://github.com/simplegeo/python-oauth2/pull/64
The last one is a pull request that includes new examples to use instead.