Installing tensorflow 1.14.0 on python2.7 on Ubuntu 20.04 - python-2.7

I'm trying to install tensorflow 1.14.0 on my Ubuntu (20.04 LTS) machine.
I need the python version 2.7.
The cmd line I'm trying to execute is
$ sudo python2.7 -m pip install tensorflow==1.14.0
but it seems there is an issue with "grpcio". The output is the following one:
Collecting tensorflow==1.14.0
Using cached tensorflow-1.14.0-cp27-cp27mu-manylinux1_x86_64.whl (109.2 MB)
Collecting backports.weakref>=1.0rc1
Using cached backports.weakref-1.0.post1-py2.py3-none-any.whl (5.2 kB)
Requirement already satisfied: keras-preprocessing>=1.0.5 in /usr/local/lib/python2.7/dist-packages (from tensorflow==1.14.0) (1.1.2)
Requirement already satisfied: six>=1.10.0 in /usr/local/lib/python2.7/dist-packages (from tensorflow==1.14.0) (1.16.0)
Collecting gast>=0.2.0
Using cached gast-0.5.3.tar.gz (23 kB)
Collecting grpcio>=1.8.6
Using cached grpcio-1.41.1.tar.gz (21.2 MB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python2.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-0d4Nnx/grpcio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-0d4Nnx/grpcio/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-zkUeEF
cwd: /tmp/pip-install-0d4Nnx/grpcio/
Complete output (11 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-0d4Nnx/grpcio/setup.py", line 256, in <module>
if check_linker_need_libatomic():
File "/tmp/pip-install-0d4Nnx/grpcio/setup.py", line 206, in check_linker_need_libatomic
stderr=PIPE)
File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I have already tried to upgrade pip (20.3.4) and setuptools (44.1.1).
I also tried to install grpcio from a repository by following this guide https://pypi.org/project/grpcio/, but I get the same error.
Do you have any suggestion?
Thank you!

I had the same exat issue as you, upgrading pip wouldn't work in my case either.
I was able to install tensorboard on my platform by installing an older version of grpcio (in my case pip install grpcio==1.20.1).
You will see some warnings on execution about some missing dynamic libraries which are ok for me, but you might want to try other grpcio version.

Related

Unable to install mod_wsgi package

I am trying to install mod_wsgi package using pip , in amazon linux 2 instance, but I keep facing an error:
Command:
python3 -m pip install mod_wsgi
OUTPUT/ERROR:
Defaulting to user installation because normal site-packages is not writeable
Collecting mod_wsgi
Using cached mod_wsgi-4.9.0.tar.gz (497 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-2sfljsxd/mod-wsgi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2sfljsxd/mod-wsgi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-54w0mlq7
cwd: /tmp/pip-install-2sfljsxd/mod-wsgi/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-2sfljsxd/mod-wsgi/setup.py", line 91, in <module>
'missing Apache httpd server packages.' % APXS)
RuntimeError: The 'apxs' command appears not to be installed or is not executable. Please check the list of prerequisites in the documentation for this package and install any missing Apache httpd server packages.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Steps taken trying to resolve the error:
1.I tried running python setup.py egg_info, but kept getting the error setup.py doesnt exist
2.I tried finding setup.py , using the command find . -name setup.py, but nothing was returned
How do I solve this?
PS: I know you are only supposed to ask one question at a time but, if there is any tutorial that explains how to use apache and mod_wsgi , to launch a django project on ec2 instance on aws, please do link it, would highly appreciate it
Thank you!

Getting an error while trying to install robotframework-appiumlibrary

Mac OS - 10.15.7
Python - 2.7.18
I used the command to install "pip install robotframework-appiumlibrary" and following is the error i get.
#Amiths-MacBook-Pro ~ % pip install robotframework-appiumlibrary
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting robotframework-appiumlibrary
Using cached robotframework_appiumlibrary-1.5.0.7-py2.py3-none-any.whl (49 kB)
Collecting docutils>=0.8.1
Using cached docutils-0.17.1-py2.py3-none-any.whl (575 kB)
Collecting six>=1.10.0
Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
Collecting decorator>=3.3.2
Using cached decorator-4.4.2-py2.py3-none-any.whl (9.2 kB)
Collecting kitchen>=1.2.4
Using cached kitchen-1.2.6.tar.gz (255 kB)
Collecting selenium>=2.47.1
Using cached selenium-3.141.0-py2.py3-none-any.whl (904 kB)
Requirement already satisfied: robotframework>=2.6.0 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from robotframework-appiumlibrary) (4.0.1)
Collecting Appium-Python-Client>=0.28
Using cached Appium-Python-Client-1.1.0.tar.gz (53 kB)
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/xn/c052lddx4qz1lm8h6thg0w_h0000gn/T/pip-install-IQfrSA/appium-python-client/setup.py'"'"'; __file__='"'"'/private/var/folders/xn/c052lddx4qz1lm8h6thg0w_h0000gn/T/pip-install-IQfrSA/appium-python-client/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/xn/c052lddx4qz1lm8h6thg0w_h0000gn/T/pip-pip-egg-info-AVKVXp
cwd: /private/var/folders/xn/c052lddx4qz1lm8h6thg0w_h0000gn/T/pip-install-IQfrSA/appium-python-client/
Complete output (8 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/xn/c052lddx4qz1lm8h6thg0w_h0000gn/T/pip-install-IQfrSA/appium-python-client/setup.py", line 19, in <module>
from appium.common.helper import library_version
File "appium/common/helper.py", line 20
def extract_const_attributes(cls: type) -> Dict[str, Any]:
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
#Amiths-MacBook-Pro ~ % python setup.py egg_info
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'setup.py': [Errno 2] No such file or directory

mysqlclient install in python3 on mac os

install mysqlclient in python3 system this error
command pip3 install mysqlclient
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tj/vjwl0qpd6l5ct6bdjgwyk1rh0000gp/T/pip-install-abwz3tky/mysqlclient/setup.py'"'"'; __file__='"'"'/private/var/folders/tj/vjwl0qpd6l5ct6bdjgwyk1rh0000gp/T/pip-install-abwz3tky/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/tj/vjwl0qpd6l5ct6bdjgwyk1rh0000gp/T/pip-install-abwz3tky/mysqlclient/pip-egg-info
cwd: /private/var/folders/tj/vjwl0qpd6l5ct6bdjgwyk1rh0000gp/T/pip-install-abwz3tky/mysqlclient/
Complete output (12 lines):
/bin/sh: mysql_config: command not found
/bin/sh: mariadb_config: command not found
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/tj/vjwl0qpd6l5ct6bdjgwyk1rh0000gp/T/pip-install-abwz3tky/mysqlclient/setup.py", line 16, in <module>
metadata, options = get_config()
File "/private/var/folders/tj/vjwl0qpd6l5ct6bdjgwyk1rh0000gp/T/pip-install-abwz3tky/mysqlclient/setup_posix.py", line 61, in get_config
libs = mysql_config("libs")
File "/private/var/folders/tj/vjwl0qpd6l5ct6bdjgwyk1rh0000gp/T/pip-install-abwz3tky/mysqlclient/setup_posix.py", line 29, in mysql_config
raise EnvironmentError("%s not found" % (_mysql_config_path,))
OSError: mysql_config not found
----------------------------------------
Did you install required prerequisites for mysqlclient?
macOS (Homebrew)
Install MySQL and mysqlclient:
Assume you are activating Python 3 venv
$ brew install mysql
$ pip install mysqlclient
If you don't want to install MySQL server, you can use mysql-client instead:
Assume you are activating Python 3 venv
$ brew install mysql-client
$ echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile
$ export PATH="/usr/local/opt/mysql-client/bin:$PATH"
$ pip install mysqlclient

django extensions OSError: [Errno 2] "dot.exe" not found in path

I am trying to install django-extensions to visualize my models in my Django rest project. Complete stacktrace:
(vb_env_drf) D:\Development\Bern\VB_rewrite\VB_DRF_Backend>pip install django-extensions
Collecting django-extensions
Using cached https://files.pythonhosted.org/packages/d4/b5/f141b351b49db2cb4c855cd8adbdb98cc49f3944a924ddfe51790bb46402/django_extensions-2.0.7-py2.py3-none-any.whl
Requirement already satisfied: six>=1.2 in d:\development\bern\vb_rewrite\vb_env_drf\lib\site-packages (from django-extensions) (1.11.0)
Requirement already satisfied: typing; python_version < "3.5" in d:\development\bern\vb_rewrite\vb_env_drf\lib\site-packages (from django-extensions) (3.6.4)
Installing collected packages: django-extensions
Successfully installed django-extensions-2.0.7
You are using pip version 10.0.0, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
(vb_env_drf) D:\Development\Bern\VB_rewrite\VB_DRF_Backend>python manage.py graph_models -a -o myapp_models.png
CommandError: Neither pygraphviz nor pydotplus could be found to generate the image
(vb_env_drf) D:\Development\Bern\VB_rewrite\VB_DRF_Backend>pip install pyparsing
Collecting pyparsing
Using cached https://files.pythonhosted.org/packages/6a/8a/718fd7d3458f9fab8e67186b00abdd345b639976bc7fb3ae722e1b026a50/pyparsing-2.2.0-py2.py3-none-any.whl
Installing collected packages: pyparsing
Successfully installed pyparsing-2.2.0
You are using pip version 10.0.0, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
(vb_env_drf) D:\Development\Bern\VB_rewrite\VB_DRF_Backend>pip install pydot
Collecting pydot
Requirement already satisfied: pyparsing>=2.1.4 in d:\development\bern\vb_rewrite\vb_env_drf\lib\site-packages (from pydot) (2.2.0)
Installing collected packages: pydot
Successfully installed pydot-1.2.4
You are using pip version 10.0.0, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
(vb_env_drf) D:\Development\Bern\VB_rewrite\VB_DRF_Backend>python manage.py graph_models -a -o myapp_models.png
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "D:\Development\Bern\VB_rewrite\vb_env_drf\lib\site-packages\django\core\management\__init__.py", line 364, in execute_from_command_line
utility.execute()
File "D:\Development\Bern\VB_rewrite\vb_env_drf\lib\site-packages\django\core\management\__init__.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "D:\Development\Bern\VB_rewrite\vb_env_drf\lib\site-packages\django\core\management\base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "D:\Development\Bern\VB_rewrite\vb_env_drf\lib\site-packages\django\core\management\base.py", line 330, in execute
output = self.handle(*args, **options)
File "D:\Development\Bern\VB_rewrite\vb_env_drf\lib\site-packages\django_extensions\management\utils.py", line 59, in inner
ret = func(self, *args, **kwargs)
File "D:\Development\Bern\VB_rewrite\vb_env_drf\lib\site-packages\django_extensions\management\commands\graph_models.py", line 168, in handle
self.render_output_pydot(dotdata, **options)
File "D:\Development\Bern\VB_rewrite\vb_env_drf\lib\site-packages\django_extensions\management\commands\graph_models.py", line 230, in render_output_pydot
graph.write(output_file, format=format)
File "D:\Development\Bern\VB_rewrite\vb_env_drf\lib\site-packages\pydot.py", line 1756, in write
s = self.create(prog, format, encoding=encoding)
File "D:\Development\Bern\VB_rewrite\vb_env_drf\lib\site-packages\pydot.py", line 1867, in create
raise OSError(*args)
OSError: [Errno 2] "dot.exe" not found in path.
(vb_env_drf) D:\Development\Bern\VB_rewrite\VB_DRF_Backend>
I have added django_extensions in my settings also,
GRAPH_MODELS = {
'all_applications': True,
'group_models': True,
}
My requirements.ts looks like following:
Django==1.11.12
djangorestframework==3.8.2
django-cors-headers==2.2.0
drfdocs==0.0.11
mysql-python==1.2.5
django-rest-auth==0.9.3
django-allauth==0.35.0
nltk==3.2.5
django-extensions==2.0.7
pyparsing==2.2.0
pydot==1.2.4
I am on Windows 10. How do I resolve this error? Do I need to add anything in my Windows path?Or for Django rest I need other library (https://github.com/chibisov/drf-extensions)
dot.exe is a graphviz executable, which is not found in the search paths.
Have you installed graphviz and its dependencies?
If yes, are they in the search path of windows?

Why am I getting a DistributionNotFound error after attempting to upgrade pip?

Running yolk -U recently I noticed that pip needed upgrading from 1.2.1 to 1.4.1 and dutifully attempted to upgrade it with
pip install --upgrade pip
Though running yolk -U again appeared to confirm a successful upgrade (pip is no longer listed as being out of date), this generated an error message
Downloading/unpacking pip from https://pypi.python.org/packages/source/p/pip/pip-1.4.1.tar.gz#md5=6afbb46aeb48abac658d4df742bff714
Downloading pip-1.4.1.tar.gz (445kB): 445kB downloaded
Running setup.py egg_info for package pip
warning: no files found matching '*.html' under directory 'docs'
warning: no previously-included files matching '*.rst' found under directory 'docs/_build'
no previously-included directories found matching 'docs/_build/_sources'
Installing collected packages: pip
Found existing installation: pip 1.2.1
Uninstalling pip:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/basecommand.py", line 107, in main
File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/commands/install.py", line 261, in run
File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/req.py", line 1162, in install
File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/req.py", line 495, in uninstall
File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/req.py", line 1492, in remove
File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/util.py", line 273, in renames
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 299, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/local/bin/pip'
And on all my subsequent attempts to use pip do as well:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module>
line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec")
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
continue # try the next older version of project
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
pkg_resources.DistributionNotFound: pip==1.2.1
I see that similar problems have been reported before, but none of the suggestions I see help resolve this.
I'm stuck, and can't maintain my Python installation.
I'm using OS 10.8.4, Python 2.7.2 in /usr/bin/python.
According to this line:
OSError: [Errno 13] Permission denied: '/usr/local/bin/pip'
It seems like a *nix permission issue, try to launch the upgrade using sudo:
sudo pip install --upgrade pip
On a side note, I'd recommend using this upgrade method: http://www.pip-installer.org/en/latest/installing.html#install-or-upgrade-pip
tl;dr version (thanks to the information given by OP ;)):
1.Download and laucnh get-pip.py from http://www.pip-installer.org/en/latest/installing.html#install-or-upgrade-pip
2.If you get an error about "invalid command 'egg_info'", you'll need to upgrade setup tools using pip install --upgrade setuptools or easy_install -U