Could not install 'xlwings' in my Ubuntu machine - python

I am trying to install xlwings module in my Ubuntu machine but failed as below
pip3 install xlwings
Collecting xlwings
Using cached https://files.pythonhosted.org/packages/cc/c9/6bb1849dbee6e8a40beb9a0d21df9787bee45cda1d0bb575a0cd388dd260/xlwings-0.15.3.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-u90aes_a/xlwings/setup.py", line 33, in <module>
raise OSError("currently only Windows and OSX are supported.")
OSError: currently only Windows and OSX are supported.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-u90aes_a/xlwings/
What is the resolution of this error? Is xlwings not supported in Ubuntu? I also tried to install the same manually as below but failed too.
cd xlwings
python setup.py install
Any suggestion will be highly appreciated.
Update on 10th July 2019
I ran code export INSTALL_ON_LINUX=1 and then installed xlwings. Installation was fine.
However when I tried to import xlwings in Python, that failed with below error:
Python 3.6.8 (default, Jan 14 2019, 11:02:34)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import xlwings
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/dist-packages/xlwings/__init__.py", line 44, in <module>
from . import _xlmac as xlplatform
File "/usr/local/lib/python3.6/dist-packages/xlwings/_xlmac.py", line 10, in <module>
import aem
ModuleNotFoundError: No module named 'aem'
I could not install package aem with below error:
pip3 install aem
Collecting aem
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python3/dist-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python3/dist-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python3/dist-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/usr/lib/python3/dist-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python3/dist-packages/pip/index.py", line 795, in get_page
resp.raise_for_status()
File "/usr/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/models.py", line 935, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://pypi.org/simple/aem/
Any solution will be highly appreciated.

please run this command before ruining pip install xlwings (for linux users)
export INSTALL_ON_LINUX=1
nice coding

You could potentially install Anaconda for Windows within Wine and then also install Excel within Wine and then maybe, maybe (no promises), you might find that xlwings... just... might... work... ... but there will likely be many speed bumps along the way...

Related

Installing pyinstaller error: raise backend unavailable

$ pip install pyinstaller
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting pyinstaller
Using cached https://files.pythonhosted.org/packages/03/32/0e0de593f129bf1d1e77eed562496d154ef4460fd5cecfd78612ef39a0cc/PyInstaller-3.4.tar.gz
Installing build dependencies ... done
Getting requirements to build wheel ... done
Exception:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/_internal/cli/base_command.py", line 179, in main
status = self.run(options, args)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/_internal/commands/install.py", line 315, in run
resolver.resolve(requirement_set)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/_internal/resolve.py", line 131, in resolve
self._resolve_one(requirement_set, req)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/_internal/resolve.py", line 294, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/_internal/resolve.py", line 242, in _get_abstract_dist_for
self.require_hashes
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/_internal/operations/prepare.py", line 349, in prepare_linked_requirement
abstract_dist.prep_for_dist(finder, self.build_isolation)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/_internal/operations/prepare.py", line 149, in prep_for_dist
reqs = self.req.pep517_backend.get_requires_for_build_wheel()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/_vendor/pep517/wrappers.py", line 71, in get_requires_for_build_wheel
'config_settings': config_settings
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/_vendor/pep517/wrappers.py", line 162, in _call_hook
raise BackendUnavailable
BackendUnavailable
This happens when I try installing pyinstaller (on MacOS Mojave) and searching I can't find anything on the error.
Strangely, if I try installing on my personal user account on the Mac (both are admin) it works.
Any suggestions?

TyperError installing jupyter

I'm trying to install jupyter on Ubuntu 14.04 LTS but I keep getting this error. I tried giving permissions to every folder and run the code as:
sudo -H pip3 install --user jupyter
But nothing worked. I also did the update on pip and it's running the latest version.
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python3.4/dist-packages/pip/commands/install.py", line 335, in run
wb.build(autobuilding=True)
File "/usr/local/lib/python3.4/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/local/lib/python3.4/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/local/lib/python3.4/dist-packages/pip/req/req_set.py", line 634, in _prepare_file
abstract_dist.prep_for_dist()
File "/usr/local/lib/python3.4/dist-packages/pip/req/req_set.py", line 129, in prep_for_dist
self.req_to_install.run_egg_info()
File "/usr/local/lib/python3.4/dist-packages/pip/req/req_install.py", line 412, in run_egg_info
self.setup_py, self.name,
File "/usr/local/lib/python3.4/dist-packages/pip/req/req_install.py", line 387, in setup_py
import setuptools # noqa
File "/root/.local/lib/python3.4/site-packages/setuptools/__init__.py", line 12, in <module>
import setuptools.version
File "/root/.local/lib/python3.4/site-packages/setuptools/version.py", line 1, in <module>
import pkg_resources
File "/root/.local/lib/python3.4/site-packages/pkg_resources/__init__.py", line 72, in <module>
import packaging.requirements
File "/root/.local/lib/python3.4/site-packages/packaging/requirements.py", line 59, in <module>
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
TypeError: __call__() missing 1 required positional argument: 'name'
Thanks for the help!
For me it works with the recent pyparsing package. Perhaps you need to upgrade your pyparsing to the recent version. If you installed it with apt-get, you need to remove the python3-pyparsing package, and install it with pip3.
sudo apt remove python3-pyparsing
sudo pip3 install pyparsing
As this answer writes, you need pyparsing>=2.0.2 to avoid this error.
I had this error as well, after a bit of digging I found this question that addresses the same error caused by some other software.
As the author states, the problem is that the call to MARKER_EXPR() should have a 'name' argument but it doesn't.
To fix this, edit line 59 of /usr/local/lib/python3.4/dist-packages/packaging/requirements.py and just add quotes to the call to MARKER_EXPR() like so:
MARKER_EXPR = originalTextFor(MARKER_EXPR(""))("marker")

`pip` is missing python 3.4.3, PyCharm IDE

I just installed python 3.4.3 and pyCharm 4.5, while installing module six. I got the following error message. I thought pip is included in python 3.4.3 installation. Any suggestions?
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.5.3\helpers\packaging_tool.py", line 56, in do_install
import pip
ImportError: No module named 'pip'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.5.3\helpers\packaging_tool.py", line 125, in main
retcode = do_install(pkgs)
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.5.3\helpers\packaging_tool.py", line 58, in do_install
error_no_pip()
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.5.3\helpers\packaging_tool.py", line 36, in error_no_pip
tb = sys.exc_traceback
AttributeError: 'module' object has no attribute 'exc_traceback'
UPDATE:
Okay, following suggestion below, I checked that there is no pip.exe on hard drive. So I downloaded get-pip.py and tried to install it. Here is the error message:
C:\Python34>python get-pip.py
Collecting pip
Using cached pip-7.1.0-py2.py3-none-any.whl
Collecting wheel
Using cached wheel-0.24.0-py2.py3-none-any.whl
Installing collected packages: pip, wheel
Found existing installation: pip 6.0.8
Exception:
Traceback (most recent call last):
File "C:\Users\somepath\AppData\Local\Temp\tmpram2_j5v\pip.zip\pip\basecommand
.py", line 223, in main
status = self.run(options, args)
File "C:\Users\somepath\AppData\Local\Temp\tmpram2_j5v\pip.zip\pip\commands\in
stall.py", line 299, in run
root=options.root_path,
File "C:\Users\somepath\AppData\Local\Temp\tmpram2_j5v\pip.zip\pip\req\req_set
.py", line 640, in install
requirement.uninstall(auto_confirm=True)
File "C:\Users\somepath\AppData\Local\Temp\tmpram2_j5v\pip.zip\pip\req\req_ins
tall.py", line 683, in uninstall
for path in pip.wheel.uninstallation_paths(dist):
File "C:\Users\somepath\AppData\Local\Temp\tmpram2_j5v\pip.zip\pip\wheel.py",
line 512, in unique
for item in fn(*args, **kw):
File "C:\Users\somepath\AppData\Local\Temp\tmpram2_j5v\pip.zip\pip\wheel.py",
line 531, in uninstallation_paths
r = csv.reader(FakeFile(dist.get_metadata_lines('RECORD')))
File "C:\Users\somepath\AppData\Local\Temp\tmpram2_j5v\pip.zip\pip\_vendor\pkg
_resources\__init__.py", line 1619, in get_metadata_lines
return yield_lines(self.get_metadata(name))
File "C:\Users\somepath\AppData\Local\Temp\tmpram2_j5v\pip.zip\pip\_vendor\pkg
_resources\__init__.py", line 1616, in get_metadata
return self._get(self._fn(self.egg_info, name)).decode("utf-8")
File "C:\Users\somepath\AppData\Local\Temp\tmpram2_j5v\pip.zip\pip\_vendor\pkg
_resources\__init__.py", line 1722, in _get
with open(path, 'rb') as stream:
FileNotFoundError: [Errno 2] No such file or directory: 'c:\\python34\\lib\\site
-packages\\pip-6.0.8.dist-info\\RECORD'
FINAL UPDATE:
Uninstalling Python and deleting C:\Python34 folder helped. New installation came with pip. Sorry for all this mess.

unable to install youtube-dl-api-server

I am unable to install youtube-dl-api-server. I am using Python 2.7.9. It looks like there is a bug in some dependency. I have tried install from source code but I was with the same result. After running command pip install –pre youtube_dl_server I got this message:
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 257, in run
InstallRequirement.from_line(name, None))
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 172, in from_line
return cls(req, comes_from, url=url, prereleases=prereleases)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 70, in __init__
req = pkg_resources.Requirement.parse(req)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2667, in parse
reqs = list(parse_requirements(s))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2593, in parse_requirements
raise ValueError("Missing distribution spec", line)
ValueError: ('Missing distribution spec', '\xe2\x80\x93r')
Storing debug log for failure in /home/ubuntu/.pip/pip.log
I am using Python 2.7.9 on Ununtu Server. Do you have any idea how to solve this?
Thanks metjuf
There is a strange character in your command, most likely the result of some automatic conversion. I'm talking about – (U+8211, b'\xe2\x80\x93' as UTF-8). So instead of
pip install –pre youtube_dl_server
run
pip install --pre youtube_dl_server

virtualenv --python=2.5 error

i am trying to install virtualenv to use python2.5 on my apple OSX 10.6 machine, but get this error when i try to:
☺ virtualenv --python=python2.5 /Users/khinester/.virtualenvs/cccorder2.5 ruby-2.0.0-p195""
Running virtualenv with interpreter /usr/bin/python2.5
New python executable in /Users/khinester/.virtualenvs/cccorder2.5/bin/python2.5
Not overwriting existing python script /Users/khinester/.virtualenvs/cccorder2.5/bin/python (you must use /Users/khinester/.virtualenvs/cccorder2.5/bin/python2.5)
Installing setuptools......................................
Complete output from command /Users/khinester/.vi...der2.5/bin/python2.5 -c "#!python
\"\"\"Bootstra...sys.argv[1:])
" --always-copy -U setuptools:
Downloading http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c11-py2.5.egg
Searching for setuptools
Reading http://pypi.python.org/simple/setuptools/
Reading http://peak.telecommunity.com/snapshots/
Reading https://pypi.python.org/pypi/setuptools
Best match: setuptools 3.3
Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-3.3.zip#md5=284fa92c5e32c113a4bc00bd20c4eef8
Processing setuptools-3.3.zip
Running setuptools-3.3/setup.py -q bdist_egg --dist-dir /var/folders/it/itEAjVAME2GWcW-Q6QxMBU+++TI/-Tmp-/easy_install-5rSJOe/setuptools-3.3/egg-dist-tmp-IL4Z_W
setup.py:17: Warning: 'with' will become a reserved keyword in Python 2.6
Traceback (most recent call last):
File "<string>", line 278, in <module>
File "<string>", line 213, in main
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 1712, in main
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 1716, in <lambda>
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/core.py", line 151, in setup
dist.run_commands()
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py", line 974, in run_commands
self.run_command(cmd)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py", line 994, in run_command
cmd_obj.run()
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 211, in run
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 446, in easy_install
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 476, in install_item
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 655, in install_eggs
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 930, in build_and_install
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 919, in run_setup
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/sandbox.py", line 62, in run_setup
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/sandbox.py", line 105, in run
File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/sandbox.py", line 64, in <lambda>
File "setup.py", line 17
with open(init_path) as init_file:
^
SyntaxError: invalid syntax
----------------------------------------
...Installing setuptools...done.
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv.py", line 2577, in <module>
main()
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv.py", line 979, in main
no_pip=options.no_pip)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv.py", line 1091, in create_environment
search_dirs=search_dirs, never_download=never_download)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv.py", line 611, in install_setuptools
search_dirs=search_dirs, never_download=never_download)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv.py", line 583, in _install_req
cwd=cwd)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv.py", line 1057, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /Users/khinester/.vi...der2.5/bin/python2.5 -c "#!python
\"\"\"Bootstra...sys.argv[1:])
" --always-copy -U setuptools failed with error code 1
all other versions of python work fine, but just this.
python2.5 is fine on the machine, as per:
☺ python2.5 ruby-2.0.0-p195""
Python 2.5.4 (r254:67916, Aug 1 2011, 15:52:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print( sys.path )
['', '/Library/Python/2.5/site-packages/virtualenv-1.11.4-py2.5.egg', '/Library/Python/2.5/site-packages/MySQL_python-1.2.5-py2.5-macosx-10.6-i386.egg', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python25.zip', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload', '/Library/Python/2.5/site-packages', '/Library/Python/2.5/site-packages/PIL', '/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/PyObjC', '/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/wx-2.8-mac-unicode']
>>>
any advice much appreciated.
I think your issue is not with virtualenv but with setuptools, that dropped python 2.5 support a few months ago. You should install an older version (probably 1.X)

Categories