Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when installing #142

Open
marcelo321 opened this issue Feb 28, 2023 · 9 comments
Open

Error when installing #142

marcelo321 opened this issue Feb 28, 2023 · 9 comments

Comments

@marcelo321
Copy link

marcelo321 commented Feb 28, 2023

# python ./aws-elastic-beanstalk-cli-setup/scripts/ebcli_installer.py

***********************************
1. Locating virtualenv installation
***********************************

******************************************
2. Creating exclusive virtualenv for EBCLI
******************************************
created virtual environment CPython3.10.6.final.0-64 in 257ms
  creator CPython3Posix(dest=/root/.ebcli-virtual-env, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/root/.local/share/virtualenv)
    added seed packages: pip==23.0.1, setuptools==67.4.0, wheel==0.38.4
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

************************
3. Activating virtualenv
************************

*******************
4. Installing EBCLI
*******************
Collecting awsebcli
  Using cached awsebcli-3.20.4.tar.gz (260 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-i0tbsjf1/awsebcli_e4afa248e75a4996bc5767081927f76d/setup.py", line 22, in <module>
          with open("requirements.txt") as req:
      FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Also finding this error everywhere which is caused by wrong usage of print in python:

# python /usr/local/lib/python3.10/dist-packages/ebcli/__init__.py
  File "/usr/local/lib/python3.10/dist-packages/ebcli/__init__.py", line 215
    print json.dumps(resource, indent=4)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

Shouldn't be print(json.dumps(resource, indent=4)) instead?

@mateus-batista
Copy link

mateus-batista commented Mar 1, 2023

I've been having the same problem, but everything was working just fine 4 days ago.

I noticed that the latest version of virtualenv is now 20.20.0, last week it was 20.19.0.

virtualenv 20.20.0 adds the packages: pip==23.0.1, setuptools==67.4.0, wheel==0.38.4
virtualenv 20.19.0 adds the packages: pip==23.0, setuptools==67.1.0, wheel==0.38.4

Platform: Ubuntu 20.04.5 LTS

@charliedzhang
Copy link

charliedzhang commented Mar 1, 2023

got same error and solved it by doing below:
/home/your user name/.ebcli-virtual-env/bin/python -m pip install --upgrade pip

@mateus-batista
Copy link

Installing the previous virtualenv version did the trick. You can do that by using

pipx install git+https://github.com/pypa/virtualenv.git#e2833afe407ea8a9b8abd79befd4339f7c1c873b

Instead of

pipx install virtualenv

@marcelo321
Copy link
Author

marcelo321 commented Mar 1, 2023

I managed to installed it with your suggestion, but now having this error.

@mateus-batista Any idea how to properly solve the print error?

# eb
Error processing line 1 of /root/.ebcli-virtual-env/lib/python3.10/site-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python2.7/site.py", line 158, in addpackage
      exec line
    File "<string>", line 1, in <module>
    File "/root/.ebcli-virtual-env/lib/python3.10/site-packages/_distutils_hack/__init__.py", line 194
      f'spec_for_{name}',
                       ^
  SyntaxError: invalid syntax

Remainder of file ignored
usage: eb (sub-commands ...) [options ...] {arguments ...}

Welcome to the Elastic Beanstalk Command Line Interface (EB CLI). 
For more information on a specific command, type "eb {cmd} --help".

commands:
  abort        Cancels an environment update or deployment.
  appversion   Listing and managing application versions
  clone        Clones an environment.

@marcelo321
Copy link
Author

I believe it might be because it is using python 2.7? File "/usr/lib/python2.7/site.py", line 158, in addpackage, how do i force it to use python3?

@mateus-batista
Copy link

I believe it might be because it is using python 2.7? File "/usr/lib/python2.7/site.py", line 158, in addpackage, how do i force it to use python3?

You may be missing some dependency libraries. Check this session of the readme file: https://github.com/aws/aws-elastic-beanstalk-cli-setup#4-troubleshooting

@marcelo321
Copy link
Author

@mateus-batista here is the output:

# apt-get install     build-essential zlib1g-dev libssl-dev libncurses-dev     libffi-dev libsqlite3-dev libreadline-dev libbz2-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
build-essential is already the newest version (12.9ubuntu3).
libbz2-dev is already the newest version (1.0.8-5build1).
libffi-dev is already the newest version (3.4.2-4).
libncurses-dev is already the newest version (6.3-2).
libreadline-dev is already the newest version (8.1.2-1).
libsqlite3-dev is already the newest version (3.37.2-2ubuntu0.1).
libssl-dev is already the newest version (3.0.2-0ubuntu1.8).
zlib1g-dev is already the newest version (1:1.2.11.dfsg-2ubuntu9.2).
The following packages were automatically installed and are no longer required:
  accountsservice crda glib-networking glib-networking-common glib-networking-services kpartx language-selector-common libaccountsservice0 libcanberra0 libfuse2
  libfwupdplugin1 libntfs-3g883 libogg0 libproxy1v5 libpython3.8 libpython3.8-dev libpython3.8-minimal libpython3.8-stdlib libsgutils2-2 libsoup2.4-1 libsoup2.4-common
  libtdb1 libvorbis0a libvorbisfile3 libwebp6 libxmlb1 ltrace php-common python-pkg-resources python-setuptools python3-debian python3.8 python3.8-dev python3.8-minimal
  ruby2.7 ruby2.7-dev ruby2.7-doc sg3-utils sg3-utils-udev sound-theme-freedesktop
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 28 not upgraded.
# eb
Error processing line 1 of /root/.ebcli-virtual-env/lib/python3.10/site-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python2.7/site.py", line 158, in addpackage
      exec line
    File "<string>", line 1, in <module>
    File "/root/.ebcli-virtual-env/lib/python3.10/site-packages/_distutils_hack/__init__.py", line 194
      f'spec_for_{name}',
                       ^
  SyntaxError: invalid syntax

Remainder of file ignored
usage: eb (sub-commands ...) [options ...] {arguments ...}

Welcome to the Elastic Beanstalk Command Line Interface (EB CLI). 
For more information on a specific command, type "eb {cmd} --help".

commands:
  abort        Cancels an environment update or deployment.
  appversion   Listing and managing application versions
  clone        Clones an environment.
  codesource   Configures the code source for the EB CLI to use by default.
  config       Modify an environment's configuration. Use subcommands to man

the weird thing is eb runs partially, always the error first and then part of the eb output.

@marcelo321
Copy link
Author

the suggestions in https://bbs.archlinux.org/viewtopic.php?id=276388 did not help neither pip uninstall setuptools

@dustinbolton
Copy link

After spending hours trying to get this to work I just used pipx as mentioned here and all installed fine: #149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants