How to install EB CLI on ubuntu 18.04 - python

I have tried lots of efforts but not found the result.
Error Showing
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3088, in <module>
#_call_aside
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3072, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3101, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 574, in _build_master
ws.require(__requires__)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 892, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 778, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'awsebcli==3.12.1' distribution was not found and is required by the application

Related

pip3 assumes its using regular pip

❯ pip3
Traceback (most recent call last):
File "/usr/local/bin/pip3", line 6, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3241, in <module>
#_call_aside
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3225, in _call_aside
f(*args, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3254, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 585, in _build_master
return cls._build_from_requirements(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 598, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==20.2.3' distribution was not found and is required by the application
For some reason it says it's accessing /System/Library/Frameworks/Python.framework/Versions/2.7.
If I type in which pip3 it outputs, /usr/local/bin/pip3.
And so I used that to put in my path like so, export PATH="/usr/local/bin/pip3:$PATH"
I also did the same thing with python3:
which python3 and outputs, /usr/bin/python3
And then I used it to put in my path:
export PATH="/usr/bin/python3:$PATH"
However, for some reason my MacBook thinks to use python 2 and regular pip.
I want to be able to use pip3.

Pip seems not to be installing module in setup.py

I have a setup.py file that looks like this:
from setuptools import setup
setup(
name='yeet',
install_requires=[
'cmake>=3.15.3',
'Cython>=0.29.21',
'glob2>=0.6',
'hdbscan>=0.8.24',
],
)
When I run python setup.py install using a Python 3.7 conda environment, I get:
Traceback (most recent call last):
File "setup.py", line 66, in <module>
'pixplot=pixplot:parse',
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/site-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/site-packages/setuptools/command/install.py", line 117, in do_egg_install
cmd.run(show_deprecation=False)
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 408, in run
self.easy_install(spec, not self.no_deps)
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 650, in easy_install
return self.install_item(None, spec, tmpdir, deps, True)
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 697, in install_item
self.process_distribution(spec, dist, deps)
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 742, in process_distribution
[requirement], self.local_index, self.easy_install
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 766, in resolve
replace_conflicting=replace_conflicting
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1049, in best_match
return self.obtain(req, installer)
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1061, in obtain
return installer(requirement)
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 669, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 695, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 880, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 1150, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 1134, in run_setup
run_setup(setup_script, args)
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/site-packages/setuptools/sandbox.py", line 257, in run_setup
raise
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/contextlib.py", line 130, in __exit__
self.gen.throw(type, value, traceback)
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/site-packages/setuptools/sandbox.py", line 193, in setup_context
yield
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/contextlib.py", line 130, in __exit__
self.gen.throw(type, value, traceback)
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/site-packages/setuptools/sandbox.py", line 164, in save_modules
saved_exc.resume()
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/site-packages/setuptools/sandbox.py", line 139, in resume
raise exc.with_traceback(self._tb)
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/site-packages/setuptools/sandbox.py", line 152, in save_modules
yield saved
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/site-packages/setuptools/sandbox.py", line 193, in setup_context
yield
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/site-packages/setuptools/sandbox.py", line 254, in run_setup
_execfile(setup_script, ns)
File "/Users/doug/anaconda/envs/3.7/lib/python3.7/site-packages/setuptools/sandbox.py", line 43, in _execfile
exec(code, globals, locals)
File "/var/folders/cy/ywx04ttn12n_xmgjf5s6sbzr0000gn/T/easy_install-ogn8e84n/hdbscan-0.8.26/setup.py", line 94, in <module>
ImportError: Cython not found! Please install cython and try again
Does anyone know why Cython isn't installed, given the fact that it's in my setup.py file? I know I can install Cython, but I'd like to prevent users from hitting this snag. Is the solution here for hdbscan to add Cython to its list of dependencies? Any pointers others can offer would be hugely appreciated!
I think you should try something like this.
from setuptools import setup, Extension
setup(
...
setup_requires=[
'setuptools>= 50.3.0',
'cython',
or something like this.
from setuptools import dist
dist.Distribution().fetch_build_eggs('Cython>=0.29.21')
Look in to the following post for more details.
https://luminousmen.com/post/resolve-cython-and-numpy-dependencies

When I put in pip --version into the terminal I get this error: "The 'pip==9.0.1' distribution was not found and is required by the application"

I put pip --version into the terminal and receive this:
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/__init__.py", line 3095, in <module>
#_call_aside
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3081, in _call_aside
f(*args, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3108, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 658, in _build_master
ws.require(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 959, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 846, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==9.0.1' distribution was not found and is required by the application
I'm using Mac
Executing:
sudo easy_install pip
should solve this issue.

Can't install anything with pip

I can't install Beautifulsoup by running:
pip install Beautifulsoup
The output was:
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3080, in <module>
#_call_aside
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3066, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3093, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 651, in _build_master
ws.require(__requires__)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 952, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 839, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==1.5.6' distribution was not found and is required by the application
What is the exact problem and what should I do?

How do I install scipy and numpy with setuptools

I am developing a python 3.4 module which has scipy and numpy as dependencies. So I declared them in my setup.py under install_requires.
Here is the minimum running example of my setup.py
from setuptools import setup
setup(
name='MyModule',
version='1.0.5',
author='Alexander Mueller',
packages=[],
scripts=[],
license='LICENSE.txt',
description='Stuff',
install_requires=[
"pandas == 0.15.2",
"scikit-learn==0.17",
"seaborn == 0.5.1",
"scipy == 0.17.0",
"numpy==1.10.4"
]
)
While running python setup.py install the following exception occurs.
However, when I install all those packages in order with pip install, no error occurs at all. Might be easy_install the problem?
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "setup.py", line 16, in <module>
"numpy==1.10.4"
File "/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/command/install.py", line 117, in do_egg_install
cmd.run()
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 380, in run
self.easy_install(spec, not self.no_deps)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 610, in easy_install
return self.install_item(None, spec, tmpdir, deps, True)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 661, in install_item
self.process_distribution(spec, dist, deps)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 709, in process_distribution
[requirement], self.local_index, self.easy_install
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/pkg_resources/__init__.py", line 830, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/pkg_resources/__init__.py", line 1075, in best_match
return self.obtain(req, installer)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/pkg_resources/__init__.py", line 1087, in obtain
return installer(requirement)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 629, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 659, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 842, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1070, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1056, in run_setup
run_setup(setup_script, args)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/sandbox.py", line 240, in run_setup
raise
File "/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/sandbox.py", line 193, in setup_context
yield
File "/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/sandbox.py", line 164, in save_modules
saved_exc.resume()
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/sandbox.py", line 139, in resume
compat.reraise(type, exc, self._tb)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/compat.py", line 65, in reraise
raise value.with_traceback(tb)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/sandbox.py", line 152, in save_modules
yield saved
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/sandbox.py", line 193, in setup_context
yield
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/sandbox.py", line 237, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/sandbox.py", line 267, in run
return func()
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/sandbox.py", line 236, in runner
_execfile(setup_script, ns)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/sandbox.py", line 46, in _execfile
exec(code, globals, locals)
File "/var/folders/b0/_y4bfk6x4bldrmtycxhmbtrm0000gn/T/easy_install-drrk1iwn/scipy-0.17.0/setup.py", line 265, in <module>
File "/var/folders/b0/_y4bfk6x4bldrmtycxhmbtrm0000gn/T/easy_install-drrk1iwn/scipy-0.17.0/setup.py", line 253, in setup_package
ImportError: No module named 'numpy'
Thank you guys in advance.
Order seems to matter here, with this order the required packages were installed
install_requires=[
"numpy == 1.10.4",
"pandas == 0.15.2",
"seaborn == 0.5.1",
"scipy == 0.17.0",
"scikit-learn == 0.17"
]
Tested with pip3 1.5.4, xubuntu 14.04

Categories