My application is PHP but uses a few Python scripts. I am able to run Python, but it does not have my required packages installed.
.ebextensions/python.conf:
packages:
yum:
python-pip: []
container_commands:
01-numpy:
command: pip install numpy
Having it run the command "pip install numpy" returns "pip: command not found"
Adding the yum bit to install "python-pip" returns "Yum does not have python-pip available for installation"
Edit: I ran these commands: "sudo yum install python-setuptools && sudo easy_install pip" The result is this error:
2021-11-15 19:11:07,456 P10778 [INFO] Command 00-pip
2021-11-15 19:11:09,658 P10778 [INFO] -----------------------Command Output-----------------------
2021-11-15 19:11:09,658 P10778 [INFO] Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
2021-11-15 19:11:09,658 P10778 [INFO] Package python2-setuptools-41.2.0-4.amzn2.0.2.noarch already installed and latest version
2021-11-15 19:11:09,658 P10778 [INFO] Nothing to do
2021-11-15 19:11:09,658 P10778 [INFO] ------------------------------------------------------------
2021-11-15 19:11:09,659 P10778 [INFO] Completed successfully.
2021-11-15 19:11:09,668 P10778 [INFO] ============================================================
2021-11-15 19:11:09,669 P10778 [INFO] Command 00-pip2
2021-11-15 19:11:11,273 P10778 [INFO] -----------------------Command Output-----------------------
2021-11-15 19:11:11,273 P10778 [INFO] Searching for pip
2021-11-15 19:11:11,273 P10778 [INFO] Reading https://pypi.org/simple/pip/
2021-11-15 19:11:11,273 P10778 [INFO] Downloading https://files.pythonhosted.org/packages/da/f6/c83229dcc3635cdeb51874184241a9508ada15d8baa337a41093fab58011/pip-21.3.1.tar.gz#sha256=fd11ba3d0fdb4c07fbc5ecbba0b1b719809420f25038f8ee3cd913d3faa3033a
2021-11-15 19:11:11,273 P10778 [INFO] Best match: pip 21.3.1
2021-11-15 19:11:11,273 P10778 [INFO] Processing pip-21.3.1.tar.gz
2021-11-15 19:11:11,273 P10778 [INFO] Writing /tmp/easy_install-LCM5Nm/pip-21.3.1/setup.cfg
2021-11-15 19:11:11,273 P10778 [INFO] Running pip-21.3.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-LCM5Nm/pip-21.3.1/egg-dist-tmp-gg7VW3
2021-11-15 19:11:11,273 P10778 [INFO] Traceback (most recent call last):
2021-11-15 19:11:11,273 P10778 [INFO] File "/bin/easy_install", line 11, in <module>
2021-11-15 19:11:11,273 P10778 [INFO] load_entry_point('setuptools==41.2.0', 'console_scripts', 'easy_install')()
2021-11-15 19:11:11,273 P10778 [INFO] File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 2315, in main
2021-11-15 19:11:11,273 P10778 [INFO] **kw
2021-11-15 19:11:11,274 P10778 [INFO] File "/usr/lib/python2.7/site-packages/setuptools/__init__.py", line 145, in setup
2021-11-15 19:11:11,274 P10778 [INFO] return distutils.core.setup(**attrs)
2021-11-15 19:11:11,274 P10778 [INFO] File "/usr/lib64/python2.7/distutils/core.py", line 151, in setup
2021-11-15 19:11:11,274 P10778 [INFO] dist.run_commands()
2021-11-15 19:11:11,274 P10778 [INFO] File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands
2021-11-15 19:11:11,274 P10778 [INFO] self.run_command(cmd)
2021-11-15 19:11:11,274 P10778 [INFO] File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command
2021-11-15 19:11:11,274 P10778 [INFO] cmd_obj.run()
2021-11-15 19:11:11,274 P10778 [INFO] File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 417, in run
2021-11-15 19:11:11,274 P10778 [INFO] self.easy_install(spec, not self.no_deps)
2021-11-15 19:11:11,274 P10778 [INFO] File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 678, in easy_install
2021-11-15 19:11:11,274 P10778 [INFO] return self.install_item(spec, dist.location, tmpdir, deps)
2021-11-15 19:11:11,274 P10778 [INFO] File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 704, in install_item
2021-11-15 19:11:11,274 P10778 [INFO] dists = self.install_eggs(spec, download, tmpdir)
2021-11-15 19:11:11,274 P10778 [INFO] File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 889, in install_eggs
2021-11-15 19:11:11,275 P10778 [INFO] return self.build_and_install(setup_script, setup_base)
2021-11-15 19:11:11,275 P10778 [INFO] File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1157, in build_and_install
2021-11-15 19:11:11,275 P10778 [INFO] self.run_setup(setup_script, setup_base, args)
2021-11-15 19:11:11,275 P10778 [INFO] File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1143, in run_setup
2021-11-15 19:11:11,275 P10778 [INFO] run_setup(setup_script, args)
2021-11-15 19:11:11,275 P10778 [INFO] File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 253, in run_setup
2021-11-15 19:11:11,275 P10778 [INFO] raise
2021-11-15 19:11:11,275 P10778 [INFO] File "/usr/lib64/python2.7/contextlib.py", line 35, in __exit__
2021-11-15 19:11:11,275 P10778 [INFO] self.gen.throw(type, value, traceback)
2021-11-15 19:11:11,275 P10778 [INFO] File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
2021-11-15 19:11:11,275 P10778 [INFO] yield
2021-11-15 19:11:11,275 P10778 [INFO] File "/usr/lib64/python2.7/contextlib.py", line 35, in __exit__
2021-11-15 19:11:11,275 P10778 [INFO] self.gen.throw(type, value, traceback)
2021-11-15 19:11:11,275 P10778 [INFO] File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 166, in save_modules
2021-11-15 19:11:11,276 P10778 [INFO] saved_exc.resume()
2021-11-15 19:11:11,276 P10778 [INFO] File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 141, in resume
2021-11-15 19:11:11,276 P10778 [INFO] six.reraise(type, exc, self._tb)
2021-11-15 19:11:11,276 P10778 [INFO] File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
2021-11-15 19:11:11,276 P10778 [INFO] yield saved
2021-11-15 19:11:11,276 P10778 [INFO] File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
2021-11-15 19:11:11,276 P10778 [INFO] yield
2021-11-15 19:11:11,276 P10778 [INFO] File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
2021-11-15 19:11:11,276 P10778 [INFO] _execfile(setup_script, ns)
2021-11-15 19:11:11,276 P10778 [INFO] File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 44, in _execfile
2021-11-15 19:11:11,276 P10778 [INFO] code = compile(script, filename, 'exec')
2021-11-15 19:11:11,276 P10778 [INFO] File "/tmp/easy_install-LCM5Nm/pip-21.3.1/setup.py", line 7
2021-11-15 19:11:11,276 P10778 [INFO] def read(rel_path: str) -> str:
2021-11-15 19:11:11,276 P10778 [INFO] ^
2021-11-15 19:11:11,276 P10778 [INFO] SyntaxError: invalid syntax
2021-11-15 19:11:11,276 P10778 [INFO] ------------------------------------------------------------
2021-11-15 19:11:11,277 P10778 [ERROR] Exited with error code 1