installing ggplot for python on windows10 64 - python

I am using python 2.7 and installed the anaconda installations too.
although I am novice user, but everything is working fine.
Then I decided to use the ggplot. (yhat package for python)
instructions says
pip install -U ggplot
I had problem that it started to install many packages including ggplot but then it halt during the statsmodels package giving the following message:
c:\Python27\Scripts>pip install -U ggplot
Collecting ggplot
Using cached ggplot-0.6.8.tar.gz
Requirement already up-to-date: six in c:\python27\lib\site-packages (from ggplot)
Collecting statsmodels (from ggplot)
Using cached statsmodels-0.6.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "c:\users\appdata\local\temp\pip-build-8ce3lv\statsmodels\setup.py", line 393, in <module>
install_requires) = check_dependency_versions(min_versions)
File "c:\users\appdata\local\temp\pip-build-8ce3lv\statsmodels\setup.py", line 119, in check_dependency_versions
if not (StrictVersion(strip_rc(npversion)) >= min_versions['numpy']):
File "C:\Python27\lib\distutils\version.py", line 40, in __init__
self.parse(vstring)
File "C:\Python27\lib\distutils\version.py", line 107, in parse
raise ValueError, "invalid version number '%s'" % vstring
ValueError: invalid version number '1.10.0.post2'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\appdata\local\temp\pip-build-8ce3lv\statsmodels
I read in SO and on gitHub many questions but nothing is clear except that it is versioning problem
I tried to upgrade the packages but I failed.
any help is appreciated.

use conda install statsmodels. works for me on Windows 10 64bit

numpy 1.10 will soon be available without the post in the version number, based on the discussion on the numpy mailing list and numpy issue tracker.
The version scanning of statsmodels cannot handle the post part since it has never been used in the past by any science or data analysis related package.
The only solution right now is to edit the setup.py of statsmodels, or switch to a numpy version that doesn't have the post version number, or edit the version number in numpy.
https://github.com/statsmodels/statsmodels/issues/2645
https://github.com/numpy/numpy/issues/6431

Related

Unable to install Rasa 1.7.0 on Windows 10

I have been trying to install rasa on my Window 10 machine. But no success so far. Environment wise I have python 3.7, pip 20.3. When I give pip install rasa==1.7.0 on anaconda powershell it takes ages to download the dependencies and finally errors out as:
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\user\Anaconda3\envs\py37\lib\site-packages\pip\_internal\cli\base_command.py", line 224, in _main
status = self.run(options, args)
File "C:\Users\user\Anaconda3\envs\py37\lib\site-packages\pip\_internal\cli\req_command.py", line 180, in wrapper
return func(self, options, args)
File "C:\Users\user\Anaconda3\envs\py37\lib\site-packages\pip\_internal\commands\install.py", line 321, in run
reqs, check_supported_wheels=not options.target_dir
File "C:\Users\user\Anaconda3\envs\py37\lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 122, in resolve
requirements, max_rounds=try_to_avoid_resolution_too_deep,
File "C:\Users\user\Anaconda3\envs\py37\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 445, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "C:\Users\user\Anaconda3\envs\py37\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 325, in resolve
for item in self.state.criteria.items()
File "C:\Users\user\Anaconda3\envs\py37\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 326, in <listcomp>
if not self._is_current_pin_satisfying(*item)
File "C:\Users\user\Anaconda3\envs\py37\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 193, in _is_current_pin_satisfying
for r in criterion.iter_requirement()
AttributeError: 'NoneType' object has no attribute 'iter_requirement'
I could not find much details on this. As already dependencies were taking lot of time, I came across New resolver takes time article which states pip 20.3 takes more time. One way to solve it is to give exact versions of dependencies which I was not sure of as am quite new to rasa. I tried using older resolver as pip install rasa==1.7.0 --use-deprecated=legacy-resolver. After sometime it errored out as below:
ERROR: Could not find a version that satisfies the requirement jaxlib>=0.1.51 (from dopamine-rl->tensor2tensor~=1.14.0->rasa==1.7.0) (from versions: none)
ERROR: No matching distribution found for jaxlib>=0.1.51 (from dopamine-rl->tensor2tensor~=1.14.0->rasa==1.7.0)
To resolve this: I did dopamine install of different version as suggested here as I was not sure what version to go with. The packages started downloading and finally gave the dependency conflict error, occurred due to usage of legacy resolver.
ERROR: pip's legacy dependency resolver does not consider dependency conflicts when selecting packages. This behaviour is the source of the following dependency conflicts.
tensorflow-metadata 0.26.0 requires absl-py<0.11,>=0.9, but you'll have absl-py 0.11.0 which is incompatible.
kfac 0.2.3 requires tensorflow-probability==0.8, but you'll have tensorflow-probability 0.7.0 which is incompatible.
If we go with new resolver then it takes lot of time in resolving dependencies. Also we are not sure what all dependency versions needs to be downloaded to fine tune it.
Any help pointers here would be much appreciated.
UPDATE
I tied the following command sequence:
pip install dopamine-rl==3.0.1
pip install absl-py>=0.9
pip install rasa==1.7.0 --use-deprecated=legacy-resolver
Rasa got installed. Installed tensor-flow after this as conda install tensorflow==1.15.0. Now when tried to check tensorflow version, got the below warning and error.
The TensorFlow Distributions library has moved to TensorFlow Probability (https://github.com/tensorflow/probability). You should update all references to use `tfp.distributions` instead of `tf.distributions`.
ImportError: cannot import name 'Layer' from 'tensorflow.python.keras.engine.base_layer' (C:\Users\user\Anaconda3\envs\py37\lib\site-packages\tensorflow_core\python\keras\engine\base_layer.py)
I see you already started a discussion on Rasa Forum, let's move the conversation there! :) https://forum.rasa.com/t/unable-to-install-rasa-1-7-0/38313

Can't install bob package by pip

I am on Windows 7 with python 3.6. I am trying to install bob package by typing pip install bob in the command window. But I get the following error:
C:\Users\azhidinov_37005\AppData\Local\Programs\boost_1_66_0\boost_1_66_0\libs\p
ython\example\quickstart>C:\Users\azhidinov_37005\AppData\Local\Programs\Python\
Python36\Scripts\pip.exe install bob
Collecting bob
Using cached bob-3.0.0.zip
Requirement already satisfied: setuptools in c:\users\azhidinov_37005\appdata\lo
cal\programs\python\python36\lib\site-packages (from bob)
Requirement already satisfied: bob.extension==2.4.5 in c:\users\azhidinov_37005\
appdata\local\programs\python\python36\lib\site-packages (from bob)
Collecting bob.blitz==2.0.14 (from bob)
Using cached bob.blitz-2.0.14.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\AZHIDI~1\AppData\Local\Temp\pip-build-hpictomi\bob.blitz\se
tup.py", line 70, in <module>
system_include_dirs=system_include_dirs,
File "c:\users\azhidinov_37005\appdata\local\programs\python\python36\lib\
site-packages\bob\extension\__init__.py", line 356, in __init__
boost_pkg = boost(boost_req.replace('boost', '').strip())
File "c:\users\azhidinov_37005\appdata\local\programs\python\python36\lib\
site-packages\bob\extension\boost.py", line 69, in __init__
raise RuntimeError("could not find boost's `version.hpp' - have you inst
alled Boost on this machine?")
RuntimeError: could not find boost's `version.hpp' - have you installed Boos
t on this machine?
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\AZHIDI~1
\AppData\Local\Temp\pip-build-hpictomi\bob.blitz\
After that I downloaded boost from here http://www.boost.org/users/history/version_1_66_0.html
Unziped and built it. Then built separetely boost.python. Now I have all of them in root directory. But when type pip install bob stil get the same error. I think python can't locate the boost directory. What should I do? Please help!
Try:
sudo apt-get install libboost-all-dev
or
https://sourceforge.net/projects/boost/files/boost-binaries/1.53.0/
From: https://www.idiap.ch/software/bob/install
Bob does not work on Windows and hence no conda packages are available
for it. It will not work even if you install it from source. If you
are an experienced user and manage to make Bob work on Windows, please
let us know through our mailing list.
There is already some effort to make Bob work on Windows:
https://github.com/bioidiap/bob.extension/pull/1
https://github.com/bioidiap/bob.blitz/pull/1
https://github.com/bioidiap/bob.core/pull/1
If you are interested and experienced, you can contribute.

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.

Failure: Centos 6.4 python easy_install is broken

I've looked at quite a lot of related questions here - no help for me. I need to repair easy_install, so that I can update distribute to a version >=0.6.28, so that I can update python matplotlib using pip and not yum.
In the process of trying to update python matplotlib from 0.99 (the default with Centos64) to 1.4.x, I got into this trouble:
pip install --upgrade matplotlib tells me this:
Complete output from command python setup.py egg_info:
The required version of distribute (>=0.6.28) is not available,
and can't be installed while this script is running. Please
install a more recent version first, using
'easy_install -U distribute'.
(Currently using distribute 0.6.10 (/usr/lib/python2.6/site-packages))
So I followed the suggestion and saw that some 0.7.x version of distribute was installed (so it seemed). Re-ran the pip command and got the exact same complaint.
Trouble with easy_install?
It was either now, or maybe after performing yum remove, then install python-setuptools that I discovered easy_install is thoroughly broken. Now when I try to run easy_install, I get this stacktrace:
Traceback (most recent call last):
File "/usr/local/bin/easy_install", line 9, in <module>
load_entry_point('distribute', 'console_scripts', 'easy_install')()
File "/usr/local/lib/python3.3/site-packages/setuptools-18.2-py3.3.egg/pkg_resources/__init__.py", line 558, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python3.3/site-packages/setuptools-18.2-py3.3.egg/pkg_resources/__init__.py", line 2681, in load_entry_point
raise ImportError("Entry point %r not found" % ((group, name),))
ImportError: Entry point ('console_scripts', 'easy_install') not found
Look at that - why is it referring to python3.3? I don't think I've got that installed. My default python is 2.6.6.
Any ideas? TIA.
Fixed it. The python3.3 bit was my clue. I found the python script for easy_install, in /usr/local/bin. The very first line designated /usr/bin/python3.3 to execute the script. Changed to 2.6 and then was good to go.
In the end I was not able to upgrade matplotlib from 0.99 to 1.4.3, because I could not upgrade basemap from 0.99 and some conflicts arose. Rather than punish myself with trying to build from source, I think I should simply upgrade my entire VM to Centos7 and I will then have much newer matplotlib.

sys_platform is not defined x64 Windows

This has been bugging me for a little while. I recently upgraded to x64 Python, and I started getting this error (example pip install).
C:\Users\<uname>\distribute-0.6.35>pip install python-qt
Collecting python-qt
Downloading python-qt-0.50.tar.gz
Building wheels for collected packages: python-qt
Running setup.py bdist_wheel for python-qt
Complete output from command C:\Python27\python.exe -c "import setuptools;__file__='c:\\users\\<uname>\\appdata\\local\\t
emp\\pip-build-vonat7\\python-qt\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bd
ist_wheel -d c:\users\<uname>\appdata\local\temp\tmpghy5gtpip-wheel-:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\<uname>\appdata\local\temp\pip-build-vonat7\python-qt\setup.py", line 11, in <module>
packages=['Qt'],
File "C:\Python27\lib\distutils\core.py", line 137, in setup
ok = dist.parse_command_line()
File "C:\Python27\lib\site-packages\distribute-0.6.35-py2.7.egg\setuptools\dist.py", line 232, in parse_command_line
result = _Distribution.parse_command_line(self)
File "C:\Python27\lib\distutils\dist.py", line 467, in parse_command_line
args = self._parse_command_opts(parser, args)
File "C:\Python27\lib\site-packages\distribute-0.6.35-py2.7.egg\setuptools\dist.py", line 558, in _parse_command_opts
nargs = _Distribution._parse_command_opts(self, parser, args)
File "C:\Python27\lib\distutils\dist.py", line 523, in _parse_command_opts
cmd_class = self.get_command_class(command)
File "C:\Python27\lib\site-packages\distribute-0.6.35-py2.7.egg\setuptools\dist.py", line 362, in get_command_class
ep.require(installer=self.fetch_build_egg)
File "C:\Python27\lib\site-packages\distribute-0.6.35-py2.7.egg\pkg_resources.py", line 2027, in require
working_set.resolve(self.dist.requires(self.extras),env,installer))
File "C:\Python27\lib\site-packages\distribute-0.6.35-py2.7.egg\pkg_resources.py", line 2237, in requires
dm = self._dep_map
File "C:\Python27\lib\site-packages\distribute-0.6.35-py2.7.egg\pkg_resources.py", line 2466, in _dep_map
self.__dep_map = self._compute_dependencies()
File "C:\Python27\lib\site-packages\distribute-0.6.35-py2.7.egg\pkg_resources.py", line 2499, in _compute_dependencies
common = frozenset(reqs_for_extra(None))
File "C:\Python27\lib\site-packages\distribute-0.6.35-py2.7.egg\pkg_resources.py", line 2496, in reqs_for_extra
if req.marker_fn(override={'extra':extra}):
File "C:\Python27\lib\site-packages\distribute-0.6.35-py2.7.egg\_markerlib\markers.py", line 109, in marker_fn
return eval(compiled_marker, environment)
File "<environment marker>", line 1, in <module>
NameError: name 'sys_platform' is not defined
----------------------------------------
Failed building wheel for python-qt
Failed to build python-qt
Installing collected packages: python-qt
Running setup.py install for python-qt
Successfully installed python-qt-0.50
The package was installed fine, but I cannot build wheels. I tried re-installing distribute manually by downloading a zip and running python setup.py install. That installed wonderfuly, without a hitch. But I still have the above problem.
How can I re-define sys_platform?
Alright, I rolled back to x86 good ole 32 bit Python, and I still have the problem. This is really concerning, because I cannot reset this after re-installing. I looked at markerlib, which looks promising, but I don't know how to use it safely. Currently I am unable to install pretty much anything from PyPI, so I am giving points to increase interest.
Any help? I really want to be able to use PyPI again.
I chose the selected answer as it is the most likely to solve the problem. I myself have moved back to x86 Python, so I cannot test this myself. Therefore, I encourage future visitors to try this answer, but I have not myself been able to test it.
Might be a bug. Check out: https://bugs.python.org/
You can manually check the markers.py file and try to fix it. I think there would a reference to sys_platform that has to be changed to sys.platform
Regarding markerlib, you can try this out-
import markerlib
marker = markerlib.compile("sys.platform == 'win32'")
marker(environment=markerlib.default_environment(), override={'sys.platform':'win32'})
To fix this error, I found that installing the 0.7.3 version of distribute fixed this. I had also upgraded setuptools and pip along the way (so they may be needed as well), but after upgrading distribute this error finally went away.
Try removing pip and distribute and setuptools, and then manually install pip using get-pip.py .
Then , download setuptools from here , extract -> go inside the extracted folder in command prompt and do python setup.py install
Then , download distribute from here , extract -> go inside the extracted folder in command prompt and do python setup.py install
I ran into this issue today myself, though on OSX. I had run --upgrade as well as trying to uninstall and reinstall it completely.
Eventually, though I went into my site packages, and saw a "correct" version of setuptools (18.1) AS WELL as an older lingering version of it (completely separate version 15.1 of it). Removing it all and reinstalling setuptools fresh fixed it for me.
Hopefully this helps someone else!
I had an old verison of distribute, which didn't correctly resolve dependencies. It was fixed with
C:\Users\cshucks>pip install --upgrade distribute
Collecting distribute
Downloading distribute-0.7.3.zip (145kB)
100% |################################| 147kB 375kB/s
Collecting setuptools>=0.7 (from distribute)
Downloading setuptools-19.2-py2.py3-none-any.whl (463kB)
100% |################################| 466kB 440kB/s
Installing collected packages: setuptools, distribute
Found existing installation: setuptools 16.0
Uninstalling setuptools-16.0:
Successfully uninstalled setuptools-16.0
Found existing installation: distribute 0.6.49
Uninstalling distribute-0.6.49:
Successfully uninstalled distribute-0.6.49
Running setup.py install for distribute
Successfully installed distribute-0.7.3 setuptools-19.2

Categories