can`t install whoosh alchemy - python

I can`t seem to install whoosh alchemy for the life of me. reference: http://pythonhosted.org/Flask-WhooshAlchemy/ . Anyway, i'm following http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world and at the part where i'm trying to install whoosh-alchemy.
I'm typing in any of these 3
flask\Scripts\pip install flask-whooshalchemy==0.55a
flask\Scripts\pip install flask-whooshalchemy
flask\Scripts\pip install flask-whooshalchemy==0.55
The error I get is the following:
Downloading/unpacking flask-whooshalchemy
Downloading Flask-WhooshAlchemy-0.55.tar.gz
Running setup.py (path:C:\users\ray\microblog\flask\build\flask-whooshalchemy\setup.py) egg_info for package flask-whooshalchemy
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "C:\users\ray\microblog\flask\build\flask-whooshalchemy\setup.py", line 28, in <module>
'requirements.txt')).xreadlines()],
AttributeError: '_io.TextIOWrapper' object has no attribute 'xreadlines'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "C:\users\ray\microblog\flask\build\flask-whooshalchemy\setup.py", line 28, in <module>
'requirements.txt')).xreadlines()],
AttributeError: '_io.TextIOWrapper' object has no attribute 'xreadlines'
I have no idea how to solve this at all... I'm trying to google this but haven't found any luck whatsoever. Maybe my google-fu is just terrible. Much appreciation for any help.

I found this pull request on Flask-WhooshAlchemy's github which talks about pip installs failing due to xreadlines call like in your error log. Try installing it directly from github where that pull request has been merged.
Here's the command to do that - pip install git+https://github.com/gyllstromk/Flask-WhooshAlchemy.git

Related

eppy - scripting language for E+, Energyplus

I tried to launch first commands of eppy package but I received strange errors:
from eppy import modeleditor
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
from eppy import modeleditor
File "C:\Users\...\AppData\Local\Programs\Python\Python310\lib\site-packages\eppy\modeleditor.py", line 26, in <module>
from eppy.idfreader import idfreader1
File "C:\Users\...\AppData\Local\Programs\Python\Python310\lib\site-packages\eppy\idfreader.py", line 24, in <module>
from eppy.idf_msequence import Idf_MSequence
File "C:\Users\...\AppData\Local\Programs\Python\Python310\lib\site-packages\eppy\idf_msequence.py", line 27, in <module>
class Idf_MSequence(collections.MutableSequence):
AttributeError: module 'collections' has no attribute 'MutableSequence'
I noticed that maybe there are some missing files but I'm not sure. I compared my files with GitHub folder:
Screeshot:
The folder resources is missing...
I don't know if this is the problem.
I installed eppy package simply with the command: pip install eppy
Can you help me?
Thank you very much :-)
Sorry I found the issue.
The problem appears only with Python 3.10, with Python 3.9 disappears.
I don't know why...
Regarding the folder "resources" you have to download it from GitHub, because the installation with pip doesn't download it.

Python error trying install mysql-connector via pip

I'm to trying create a project in Python using Django. One of the dependencies is a connection with Mysql. I'm Using pip to import whatever I need.
My problem is the error when I run this line: sudo pip3 install mysql-python
The return is:
Collecting mysql-python
Using cached https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-6dok9yt5/mysql-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/tmp/pip-install-6dok9yt5/mysql-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
The final line is: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-6dok9yt5/mysql-python/
Someone can help me? Thanks in advance!
As far as I know "mysql-python" currently does not support python3
MySQL-3.23 through 5.5 and Python-2.4 through 2.7 are currently supported. Python-3.0 will be supported in a future release. PyPy is supported.
Maybe this will help:
https://stackoverflow.com/a/25724855/966660

I cannot install Flask-Spyne, during instalation TypeError appear

I am trying to install python module Flask-Spyne on Windows and when I type pip install Flask-Spyne, on Sec-Wall collecting TypeError appear.
I am using Python 3.5.1 on Windows 10
This is it:
C:\Windows\system32>pip install flask-spyne
Collecting flask-spyne
Using cached Flask-Spyne-0.2.tar.gz
Collecting flask (from flask-spyne)
Using cached Flask-0.11.1-py2.py3-none-any.whl
Collecting spyne (from flask-spyne)
Using cached spyne-2.12.11.tar.gz
Collecting sec-wall (from flask-spyne)
Using cached sec-wall-1.2.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\SIVK~1\AppData\Local\Temp\pip-build-mydzld6p\sec-wall\setup.py", line 30, in <module>
packages = find_packages(b"src"),
File "c:\program files (x86)\python35-32\lib\site-packages\setuptools\__init__.py", line 51, in find
out = cls._find_packages_iter(convert_path(where))
File "c:\program files (x86)\python35-32\lib\distutils\util.py", line 129, in convert_path
paths = pathname.split('/')
TypeError: a bytes-like object is required, not 'str'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\SIVK~1\AppData\Local\Temp\pip-build-mydzld6p\sec-wall\
I tried solve python setup.py egg_info error, nothing.
I tried to look at that TypeError, nothing.
Does someone know how to solve it? For any advice I am happy :)
PS: If it help, that when I type pip install suds, this appear:
C:\Windows\system32>pip install suds
Collecting suds
Using cached suds-0.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\SIVK~1\AppData\Local\Temp\pip-build-l7jpgeg4\suds\setup.py", line 20, in <module>
import suds
File "C:\Users\SIVK~1\AppData\Local\Temp\pip-build-l7jpgeg4\suds\suds\__init__.py", line 154, in <module>
import client
ImportError: No module named 'client'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\SIVK~1\AppData\Local\Temp\pip-build-l7jpgeg4\suds\
According to Spyne's documentation, it's known to work with Python versions 2.6. and 2.7, but Python 3 support is not tested.
Also, the error you've got TypeError: a bytes-like object is required, not 'str' is what people often experience when migrating their code from python 2.7 to python 3.
I can reproduce your error when installing the package for python 3.5. And I got no errors when installing it for Python 2.7.
So, maybe you have to switch to Python 2.7, and/or report the problem to the package's developer.

Tweepy Installation Issue

I am having problems with importing tweedy:
this is the error received
Traceback (most recent call last):
File "star_twitter.py", line 71, in <module>
send_to_twitter(get_price())
File "star_twitter.py", line 9, in send_to_twitter
import tweepy
ImportError: No module named tweepy
I tried re-installing it but now am receiving the following error message
Downloading/unpacking tweepy
Downloading tweepy-3.3.0.tar.gz
Running setup.py egg_info for package tweepy
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/pi/build/tweepy/setup.py", line 17, in <module>
install_reqs = parse_requirements('requirements.txt', session=uuid.uuid1())
TypeError: parse_requirements() got an unexpected keyword argument 'session'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/pi/build/tweepy/setup.py", line 17, in <module>
install_reqs = parse_requirements('requirements.txt', session=uuid.uuid1())
TypeError: parse_requirements() got an unexpected keyword argument 'session'
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /home/pi/build/tweepy
Storing complete log in /root/.pip/pip.log
Your assistance will be appreciated
You may have faced known problem. Try upgrading pip.
sudo pip install --upgrade pip
The fact that you're using virtualenv does help. If you used sudo trying to install tweepy then that's where the installation went wrong.
Try using pip install tweepy only.
If you're still getting an error from that then your virtualenv has probably became corrup. Do the following:
$ deactivate
$ rmvirtualenv nlmanagement
$ mkvirtualenv nlmanagement
$ pip install -r requirements.txt
Try the pip installation first and only use that for future needs in virtualenv.

Error installing python preppy

When installing preppy in a virtualenv on my workstation (Ubuntu Linux) it works, but when installing it the same way on an instance of Amazon Linux I get an error like this:
(env)[ec2-user#server t]$ pip install preppy
Downloading/unpacking preppy
Downloading preppy-2.3.2.tar.gz (42kB): 42kB downloaded
Running setup.py (path:/home/ec2-user/t/env/build/preppy/setup.py) egg_info for package preppy
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/home/ec2-user/t/env/build/preppy/setup.py", line 13, in <module>
import preppy
File "/home/ec2-user/t/env/build/preppy/preppy.py", line 72, in <module>
isPy3 = sys.version_info.major == 3
AttributeError: 'tuple' object has no attribute 'major'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/home/ec2-user/t/env/build/preppy/setup.py", line 13, in <module>
import preppy
File "/home/ec2-user/t/env/build/preppy/preppy.py", line 72, in <module>
isPy3 = sys.version_info.major == 3
AttributeError: 'tuple' object has no attribute 'major'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/ec2-user/t/env/build/preppy
Storing debug log for failure in /home/ec2-user/.pip/pip.log
This hints at a problem when checking what the Python version is, but googling around did not help me this time.
I'm aware that python packages sometimes have dependencies on host software, eg to install psycopg2 I had to first install the Postgres development packages on the operating system.
So how do I fix this error?
Your ec2 instance needs to be running (at least) Python 2.7.
sys.version_info didn't become a named tuple until 2.7.

Categories