IPTCInfo on Python 3.x Windows - python

I need to extract IPTC metadata from images. Most of the things I've read about Python packages on Windows suggest using pre-compiled binaries, but I don't see one for IPTCInfo, thus I tried pip3.
I'm getting an error from pip when trying to install this:
C:\Users\hackr>pip3 install IPTCInfo
Collecting IPTCInfo
Downloading IPTCInfo-1.9.5-6.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\hackr\AppData\Local\Temp\pip-build-v4m344a7\IPTCInfo\setup.py", line 32
print self.get_archive_files()
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\hackr\AppData\Local\Temp\pip-build-v4m344a7\IPTCInfo
So, I tried to open that last temporary file it refrences, but it doesn't appear to exist...

I have the same problem. Appears the IPTCinfo is for python-2. I will upgrade IPTCinfo for python-3.
However I have found the library exvi2 which provides the same type of image support. There is a python interface for this at https://wiki.gnome.org/Projects/gexiv2

I maintain IPTCInfo3 in Pypi. I recommend downloading it via pip3 install iptcinfo3 as it is specifically upgraded for Python3x. Follow the readme and issue comments for examples. Enjoy.

Related

pip install setup.py missing when attemping install of pyodbc wheel file

i'm trying to update the pyodbc package from 4.0.16 to 4.0.22.
i dont have internet access on the machine i'm working on so downloaded the file and copied to across the network.
running
pip install S:\Temp\PMCD\pyodbc-4.0.22-py27hc56fc5f_0(1).tar.bz2
results in the following error:
Processing s:\temp\pmcd\pyodbc-4.0.22-py27hc56fc5f_0(1).tar.bz2
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
IOError: [Errno 2] No such file or directory: 'c:\\users\\adm_pa~2\\appdata\\local\\temp\\2\\pip-yf25bd-build\\setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\adm_pa~2\appdata\local\temp\2\pip-yf25bd-build\
setuptools has already been updated to latest(38.5.1) and pip as well (9.0.1)
i used pip to update setuptools and pip itself (via downloaded whl files), so i dont think pip is an issue.
i already managed to sucessfully upgrade pyodbc on my local machine from 16 to 22, so the whl file i have not sure whats going on.
Any ideas whats going on?
Could i manually unzip the package and place it directly in the site-packages? that didnt seem to do anything.
If your target machine does not have a direct Internet connection you can still install pyodbc by
using another machine to download the appropriate wheel (.whl) file from PyPI,
copying that file to your target machine (via LAN, SneakerNet, ...), and
using pip install <wheel_file_location>
For example,
pip install C:\__tmp\pyodbc-4.0.22-cp27-cp27m-win_amd64.whl
The naming convention for wheel files is described in PEP 491.
The 64-bit wheel files for Windows are tagged as "win_amd64" because that's what the Windows version of distutils reports as the platform:
>>> from distutils import util
>>> distutils.util.get_platform()
'win-amd64'

Error when installing scapy

Ok so i'm trying to install scapy for python3, but ive been having some issues
when I enter this command:
pip install scapy
This is the output:
Collecting scapy
Using cached scapy-2.3.3.tgz
In the tar file C:\Users\MYNAME~1\AppData\Local\Temp\pip-oao3meyq-
unpack\scapy-2.3.3.tgz the member scapy-2.3.3/README
is invalid: unable to resolve link inside archive
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\MYNAME~1\AppData\Local\Temp\pip-build-
qjegdxw6\scapy\setup.py", line 36
os.chmod(fname, 0755)
^
SyntaxError: invalid token
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\MYNAME~1\AppData\Local\Temp\pip-build-qjegdxw6\s
capy\
So then I searched around and I tried using this:
pip3 install scapy-python3
But it just says that pip3 isnt a command, so im not sure what to do
Instead of pip3 use pip
pip install scapy-python3
It worked for me. pip3 is usually used if you have both python2 and python3 installed on your machine. It is uesd to distinguish between different pips in your system.
The pip3.exe will be in python3x/scripts/.
Check if there is a pip3.exe is available in your scripts folder.
If the above solution doesn't work for you then try giving the full path of correct pip.exe.

Install failed with Django-Chronograph by pip in django 1.10

Similar to this question but i got a different error.
I'm try to installing via pip with:
pip install django-chronograph
I'm using python 2.7 and a virtualenv
pip freeze
Django==1.10
django-backbone==0.2.3
django-jstemplate==1.1.1
gunicorn==18.0
MySQL-python==1.2.5
six==1.10.0
South==0.7.6
unicodecsv==0.9.4
Error:
pip install django-chronograph
Collecting django-chronograph
Using cached django-chronograph-0.3.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/87/h3ltndc5279cknk_vn9nzjjc0000gn/T/pip-build-_JDRxl/django-chronograph/setup.py", line 32, in <module>
setup_distribute()
File "/private/var/folders/87/h3ltndc5279cknk_vn9nzjjc0000gn/T/pip-build-_JDRxl/django-chronograph/setup.py", line 18, in setup_distribute
distribute_setup = __import__('distribute_setup')
File "distribute_setup.py", line 1
<html>
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/87/h3ltndc5279cknk_vn9nzjjc0000gn/T/pip-build-_JDRxl/django-chronograph/
The problem is with the installation script provided by django-chronograph.
In line 16 of setup.py, it tries to download a script:
https://bitbucket.org/wnielson/django-chronograph/src/f561106f6aaab62f2817e08e51c799320fd916d9/setup.py?at=default&fileviewer=file-view-default#setup.py-16
in this code block:
try:
import distribute_setup
except:
# Make sure we have Distribute
if not os.path.exists('distribute_setup'):
urllib.urlretrieve('http://nightly.ziade.org/distribute_setup.py',
'./distribute_setup.py')
However, when you visit the URL at http://nightly.ziade.org/distribute_setup.py, it gives a 404 error, thus the returned html in the error.
It looks like you might be able to get distribute here: https://pypi.python.org/pypi/distribute/0.7.3
Or try doing this before you install django-chronograph:
pip install distribute
Good luck!
django-chronograph is unmaintained. Its fork is doing much better and has support for Django 2.0 and Django 2.1: https://github.com/chrisspen/django-chroniker

Syntax error when installing csc-pysparse

I am new to Python and I am trying to install recsys package.
http://ocelma.net/software/python-recsys/build/html/installation.html
For this i need to install some pre-requiste packages, so i have to run this using pip
pip install csc-pysparse networkx divisi2
But whenever i run this i get the following in logs
Collecting csc-pysparse
Using cached csc-pysparse-1.1.1.4.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\64\AppData\Local\Temp\pip-build-wn7_65_9\csc-pysparse\
setup.py", line 33
print 'setuptools module not found.'
^
SyntaxError: Missing parentheses in call to 'print'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\i054564\
AppData\Local\Temp\pip-build-wn7_65_9\csc-pysparse\
I checked that setuptools exist in my python installation here
C:\Python34\lib\site-packages
I have ran everything from unstinalling setuptools to install it again, upgrade command, but it does not work.
Not able to figure out why setuptools is not found. Is it not found in the path of where pip resolves it from ?
cheers,
Saurav
The code triggering the error is Python 2-specific and is illegal in Python 3.
Apparently, csc-pysparse doesn't support Python 3 (its README only mentions 2.6) and looks abandoned (6 years since last commit).
Some guys out there suggest replacing it with SciPy.
The error is coming from the installation code of recsys package. In order to avoid this error, you need to install setuptools separately.
For debian machines, the below command will work.
sudo apt-get install python3-setuptools
For other machines, please checkout installation instructions at the link
Once setuptools package is installed, you can proceed with csc-pysparse installation.

Getting setup.py issues installing packages on Pycharm

pretty new to Python/PyCharm and I'm having some issues installing packages. Specifically I'm having issues with BeautifulSoup. I get this error when trying to install it using Project Interpreter:
Collecting BeautifulSoup
Using cached BeautifulSoup-3.2.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/5d/13rfvrgn3b5c1n52l2ngrhzh0000gn/T/pycharm-packaging1.tmp/BeautifulSoup
I've tried all the other solutions that I can find on the web such as running pip install --user BeautifulSoup, I've updated SetupTools and Pip to be running the most recent version, etc. This only happens when I try to install on the Python 3.4 Project Interpreter.
If I switch to the Python 2.6.8 Interpreter, it will install. However when I try import BeautifulSoup, it says package not found. I'm sure this is an easier fix but if someone could please help that would be great! I'm getting pretty frustrated at this point. :/

Categories