Installing Pattern for Python 3 - python

I have installed Python 3 via Anaconda 3 to my PC which runs Windows10.
In trying to install pattern I get an error message:
(base) C:\Users\Alienware\Documents>pip install pattern
Collecting pattern
Using cached https://files.pythonhosted.org/packages/bf/50/d09941d53416f2a86676bd0dc341d5968b599a763b73f5d13f51c57b5641/pattern-2.6.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\ALIENW~1\AppData\Local\Temp\pip-install-w36z8q7u\pattern\setup.py", line 40
print n
^
SyntaxError: Missing parentheses in call to 'print'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\ALIENW~1\AppData\Local\Temp\pip-install-w36z8q7u\pattern\
Moreover at Github (https://github.com/clips/pattern) it is stated that:
Pattern supports Python 2.7 and Python 3.6+. The Python 3 version is
currently only available on the development branch.
But how do I access the 'development branch'?
On the other hand, I have successfully installed pattern3 to use with Python 3 but I can not find documentation for pattern3 (compatible with Python 3) using Google.
Update
#Roshan, I am running into an exception. See below:

Related

I am unable to install Jinja in Pycharm using pip3 install Jinja. How to solve this error?

$ pip3 install Jinja
Collecting Jinja
Using cached https://files.pythonhosted.org/packages/df/50/70f41c599cf0ace6c554b07108916513c70d0e950b0abb18c27a865df7a2/Jinja-1.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-zmxr6gb7/Jinja/setup.py", line 28
except DistutilsError, e:
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-zmxr6gb7/Jinja/
Jinja is old and supports only Python 2.
I guess you want to install Jinja2.

error in installing watson-machine-learning-client

On using command pip install watson-machine-learning-client
The terminal throws error, here is the output of terminal:
pip install watson-machine-learning-client
Collecting watson-machine-learning-client
Using cached https://files.pythonhosted.org/packages/7a/ea/75de2fe2373cb3d2f0c7342b35956c4df62fce5a312cfd652a339bfb97a0/watson_machine_learning_client-1.0.357.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/l0/8fv181bn3nb6fdrnyk87j7qc0000gn/T/pip-install-oRyoix/watson-machine-learning-client/setup.py", line 30, in <module>
with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
TypeError: 'encoding' is an invalid keyword argument for this function
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/l0/8fv181bn3nb6fdrnyk87j7qc0000gn/T/pip-install-oRyoix/watson-machine-learning-client/
you are using python 2 to install the package, which is incorrectly listed as supporting python 2 on PyPi. As you can see on the official homepage (Requirements section):
Watson Machine Learning service instance, you can create instance using this link. Only Python 3.5 or newer is supported.
You can try backporting the code to python 2, but I would rather recommend using pyhton 3 here.

Install pyspec module in Anaconda

After installing Anaconda with python3 under C (Path: C:\Anaconda)and setting the path to the environmental variables in windows 10 system, I try to install "pyspec" module to Anaconda in command lines. It turns out to the following messages:
C:\Users\Timothy>pip install pyspec
Collecting pyspec
Using cached https://files.pythonhosted.org/packages/f0/36/fdcd349f2873a5ebd16b7ba2ed4c869a7474e1a77c2f1b6371ff2cfe0ee3/pyspec-0.2-r213.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\Timothy\AppData\Local\Temp\pip-install-a766ikbc\pyspec\setup.py", line 15, in <module>
from ez_setup import use_setuptools
File "C:\Users\Timothy\AppData\Local\Temp\pip-install-a766ikbc\pyspec\ez_setup.py", line 106
except pkg_resources.VersionConflict, e:
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Timothy\AppData\Local\Temp\pip-install-a766ikbc\pyspec\
And I have no idea what happened. Could anybody help me to fix it?
One of the files in pyspec, namely the file ez-setup.py, has the line
except pkg_resources.VersionConflict, e:
Unfortunately, that syntax is acceptable in Python 2 but not in Python 3. The Python 3 syntax is
except pkg_resources.VersionConflict as e:
This shows that pyspec was written for Python version 2 and will not work with Python version 3. Its PyPI page shows that the package has not been updated since July 21, 2011. Most worrying, there are no versions of Python listed for the package. That means it was indeed written for Python 2 and has not been updated to Python 3.
Your best bet is to use another package. Using such an old, outdated package is not wise. If you really want to try, you could use 2to3 or something similar to attempt to convert pyspec to Python 3. But that would probably be a nightmare.
You could try to contact the authors, Stuart B. Wilkins and Certified Scientific Software, for updated code. (Contact info is in that PyPI page).

python-weka-wrapper installing failed with error code 1 in python3.6 version

i'm installing github's python-weka-wrapper with the latest version.
i've installed other library with "pip install ___".
but i got this error code when i'm trying to install the python-weka-wrapper pkg
Collecting python-weka-wrapper
Using cached python-weka-wrapper-0.3.10.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/sf/fwjdy8n10j721jhhp85cpbz40000gn/T/pip-build-xdr96_le/python-weka-wrapper/setup.py", line 41
except HTTPError, e:
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/sf/fwjdy8n10j721jhhp85cpbz40000gn/T/pip-build-xdr96_le/python-weka-wrapper/
this msg keep pops in and i've edited "HTTPError, e" syntax to "HTTPError as e"
and this error aren't solved yet.
please help me!!!!!!!!!
Your log output indicates that you're trying to install version python-weka-wrapper, which is Python 2.7 only. Instead, install python-weka-wrapper3 when using Python 3.

IPTCInfo on Python 3.x Windows

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.

Categories