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

pypi2pkgbuild not found in PATH after pacman/yay installation #9

Open
maximberezin97 opened this issue Mar 20, 2022 · 4 comments
Open

Comments

@maximberezin97
Copy link

maximberezin97 commented Mar 20, 2022

Environment

  • Manjaro 21.2.5
    • Using package managers pacman and pamac and yay AUR helper
  • Linux kernel x86_64 Linux 5.16.14-1-MANJARO
  • zsh 5.8.1
  • bash 5.1.16
    • PATH: /home/user/.asdf/shims:/opt/asdf-vm/bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin
  • Python 3.10.3
    • /usr/bin/python installed on system via pacman
    • /home/user/.asdf/shims/python installed via asdf version manager
    • virtual environment created with /usr/bin/python
    • virtual environment created with /home/user/.asdf/shims/python

Behavior

After installing pypi2pkgbuild via package manager, the executables pypi2pkgbuild or pypi2pkgbuild.py are not in my PATH.
Issue encountered at this step.
Issue persists in every combination of tools listed in my environment.

Attempting to install simply with yay

yay -S pip2pkgbuild
Output
:: Checking for conflicts...
:: Checking for inner conflicts...
[Aur:1]  pip2pkgbuild-0.3.2-1

  1 pip2pkgbuild                     (Installed) (Build Files Exist)
==> Packages to cleanBuild?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> a
:: Deleting (1/1): /home/user/.cache/yay/pip2pkgbuild
:: (1/1) Downloaded PKGBUILD: pip2pkgbuild
  1 pip2pkgbuild                     (Installed) (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> n
:: (1/1) Parsing SRCINFO: pip2pkgbuild
==> Making package: pip2pkgbuild 0.3.2-1 (Sat 19 Mar 2022 07:02:47 PM EDT)
==> Retrieving sources...
  -> Downloading pip2pkgbuild-0.3.2.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 10469  100 10469    0     0   149k      0 --:--:-- --:--:-- --:--:--  149k
==> Validating source files with sha256sums...
    pip2pkgbuild-0.3.2.tar.gz ... Passed
==> Making package: pip2pkgbuild 0.3.2-1 (Sat 19 Mar 2022 07:02:48 PM EDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found pip2pkgbuild-0.3.2.tar.gz
==> Validating source files with sha256sums...
    pip2pkgbuild-0.3.2.tar.gz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting pip2pkgbuild-0.3.2.tar.gz with bsdtar
==> Starting prepare()...
==> Sources are ready.
==> Making package: pip2pkgbuild 0.3.2-1 (Sat 19 Mar 2022 07:02:50 PM EDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting build()...
/home/user/.cache/yay/pip2pkgbuild/src/pip2pkgbuild-0.3.2/setup.py:1: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
  import imp
running build
running build_py
creating build
creating build/lib
creating build/lib/pip2pkgbuild
copying pip2pkgbuild/__init__.py -> build/lib/pip2pkgbuild
copying pip2pkgbuild/__main__.py -> build/lib/pip2pkgbuild
copying pip2pkgbuild/pip2pkgbuild.py -> build/lib/pip2pkgbuild
running build
running build_py
creating build
creating build/lib
creating build/lib/pip2pkgbuild
copying pip2pkgbuild/__init__.py -> build/lib/pip2pkgbuild
copying pip2pkgbuild/__main__.py -> build/lib/pip2pkgbuild
copying pip2pkgbuild/pip2pkgbuild.py -> build/lib/pip2pkgbuild
==> Entering fakeroot environment...
==> Starting package_pip2pkgbuild()...
/home/user/.cache/yay/pip2pkgbuild/src/pip2pkgbuild-0.3.2/setup.py:1: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
  import imp
running install
running install_lib
creating /home/user/.cache/yay/pip2pkgbuild/pkg/pip2pkgbuild/home
creating /home/user/.cache/yay/pip2pkgbuild/pkg/pip2pkgbuild/home/user
creating /home/user/.cache/yay/pip2pkgbuild/pkg/pip2pkgbuild/home/user/.asdf
creating /home/user/.cache/yay/pip2pkgbuild/pkg/pip2pkgbuild/home/user/.asdf/installs
creating /home/user/.cache/yay/pip2pkgbuild/pkg/pip2pkgbuild/home/user/.asdf/installs/python
creating /home/user/.cache/yay/pip2pkgbuild/pkg/pip2pkgbuild/home/user/.asdf/installs/python/3.10.3
creating /home/user/.cache/yay/pip2pkgbuild/pkg/pip2pkgbuild/home/user/.asdf/installs/python/3.10.3/lib
creating /home/user/.cache/yay/pip2pkgbuild/pkg/pip2pkgbuild/home/user/.asdf/installs/python/3.10.3/lib/python3.10
creating /home/user/.cache/yay/pip2pkgbuild/pkg/pip2pkgbuild/home/user/.asdf/installs/python/3.10.3/lib/python3.10/site-packages
creating /home/user/.cache/yay/pip2pkgbuild/pkg/pip2pkgbuild/home/user/.asdf/installs/python/3.10.3/lib/python3.10/site-packages/pip2pkgbuild
copying build/lib/pip2pkgbuild/__init__.py -> /home/user/.cache/yay/pip2pkgbuild/pkg/pip2pkgbuild/home/user/.asdf/installs/python/3.10.3/lib/python3.10/site-packages/pip2pkgbuild
copying build/lib/pip2pkgbuild/__main__.py -> /home/user/.cache/yay/pip2pkgbuild/pkg/pip2pkgbuild/home/user/.asdf/installs/python/3.10.3/lib/python3.10/site-packages/pip2pkgbuild
copying build/lib/pip2pkgbuild/pip2pkgbuild.py -> /home/user/.cache/yay/pip2pkgbuild/pkg/pip2pkgbuild/home/user/.asdf/installs/python/3.10.3/lib/python3.10/site-packages/pip2pkgbuild
byte-compiling /home/user/.cache/yay/pip2pkgbuild/pkg/pip2pkgbuild/home/user/.asdf/installs/python/3.10.3/lib/python3.10/site-packages/pip2pkgbuild/__init__.py to __init__.cpython-310.pyc
byte-compiling /home/user/.cache/yay/pip2pkgbuild/pkg/pip2pkgbuild/home/user/.asdf/installs/python/3.10.3/lib/python3.10/site-packages/pip2pkgbuild/__main__.py to __main__.cpython-310.pyc
byte-compiling /home/user/.cache/yay/pip2pkgbuild/pkg/pip2pkgbuild/home/user/.asdf/installs/python/3.10.3/lib/python3.10/site-packages/pip2pkgbuild/pip2pkgbuild.py to pip2pkgbuild.cpython-310.pyc
writing byte-compilation script '/tmp/tmp_zh_13jt.py'
/home/user/.asdf/installs/python/3.10.3/bin/python -Wignore:The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives:DeprecationWarning /tmp/tmp_zh_13jt.py
removing /tmp/tmp_zh_13jt.py
running install_egg_info
running egg_info
writing pip2pkgbuild.egg-info/PKG-INFO
writing dependency_links to pip2pkgbuild.egg-info/dependency_links.txt
writing entry points to pip2pkgbuild.egg-info/entry_points.txt
writing top-level names to pip2pkgbuild.egg-info/top_level.txt
reading manifest file 'pip2pkgbuild.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pip2pkgbuild.egg-info/SOURCES.txt'
Copying pip2pkgbuild.egg-info to /home/user/.cache/yay/pip2pkgbuild/pkg/pip2pkgbuild/home/user/.asdf/installs/python/3.10.3/lib/python3.10/site-packages/pip2pkgbuild-0.3.2-py3.10.egg-info
running install_scripts
Installing pip2pkgbuild script to /home/user/.cache/yay/pip2pkgbuild/pkg/pip2pkgbuild/home/user/.asdf/installs/python/3.10.3/bin
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "pip2pkgbuild"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Starting package_python2-pip2pkgbuild()...
running install
running install_lib
creating /home/user/.cache/yay/pip2pkgbuild/pkg/python2-pip2pkgbuild/usr
creating /home/user/.cache/yay/pip2pkgbuild/pkg/python2-pip2pkgbuild/usr/lib
creating /home/user/.cache/yay/pip2pkgbuild/pkg/python2-pip2pkgbuild/usr/lib/python2.7
creating /home/user/.cache/yay/pip2pkgbuild/pkg/python2-pip2pkgbuild/usr/lib/python2.7/site-packages
creating /home/user/.cache/yay/pip2pkgbuild/pkg/python2-pip2pkgbuild/usr/lib/python2.7/site-packages/pip2pkgbuild
copying build/lib/pip2pkgbuild/__init__.py -> /home/user/.cache/yay/pip2pkgbuild/pkg/python2-pip2pkgbuild/usr/lib/python2.7/site-packages/pip2pkgbuild
copying build/lib/pip2pkgbuild/__main__.py -> /home/user/.cache/yay/pip2pkgbuild/pkg/python2-pip2pkgbuild/usr/lib/python2.7/site-packages/pip2pkgbuild
copying build/lib/pip2pkgbuild/pip2pkgbuild.py -> /home/user/.cache/yay/pip2pkgbuild/pkg/python2-pip2pkgbuild/usr/lib/python2.7/site-packages/pip2pkgbuild
byte-compiling /home/user/.cache/yay/pip2pkgbuild/pkg/python2-pip2pkgbuild/usr/lib/python2.7/site-packages/pip2pkgbuild/__init__.py to __init__.pyc
byte-compiling /home/user/.cache/yay/pip2pkgbuild/pkg/python2-pip2pkgbuild/usr/lib/python2.7/site-packages/pip2pkgbuild/__main__.py to __main__.pyc
byte-compiling /home/user/.cache/yay/pip2pkgbuild/pkg/python2-pip2pkgbuild/usr/lib/python2.7/site-packages/pip2pkgbuild/pip2pkgbuild.py to pip2pkgbuild.pyc
writing byte-compilation script '/tmp/tmpFP4gr8.py'
/usr/bin/python2 -O /tmp/tmpFP4gr8.py
removing /tmp/tmpFP4gr8.py
running install_egg_info
running egg_info
writing pip2pkgbuild.egg-info/PKG-INFO
writing top-level names to pip2pkgbuild.egg-info/top_level.txt
writing dependency_links to pip2pkgbuild.egg-info/dependency_links.txt
writing entry points to pip2pkgbuild.egg-info/entry_points.txt
reading manifest file 'pip2pkgbuild.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pip2pkgbuild.egg-info/SOURCES.txt'
Copying pip2pkgbuild.egg-info to /home/user/.cache/yay/pip2pkgbuild/pkg/python2-pip2pkgbuild/usr/lib/python2.7/site-packages/pip2pkgbuild-0.3.2-py2.7.egg-info
running install_scripts
Installing pip2pkgbuild script to /home/user/.cache/yay/pip2pkgbuild/pkg/python2-pip2pkgbuild/usr/bin
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "python2-pip2pkgbuild"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: pip2pkgbuild 0.3.2-1 (Sat 19 Mar 2022 07:02:52 PM EDT)
==> Cleaning up...
[sudo] password for user: 
loading packages...
warning: pip2pkgbuild-0.3.2-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Package (1)   Old Version  New Version  Net Change

pip2pkgbuild  0.3.2-1      0.3.2-1        0.00 MiB

Total Installed Size:  0.07 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                                                                                [#######################################################################################] 100%
(1/1) checking package integrity                                                                                                              [#######################################################################################] 100%
(1/1) loading package files                                                                                                                   [#######################################################################################] 100%
(1/1) checking for file conflicts                                                                                                             [#######################################################################################] 100%
(1/1) checking available disk space                                                                                                           [#######################################################################################] 100%
:: Running pre-transaction hooks...
(1/1) Creating Timeshift snapshot before upgrade...
==> skipping timeshift-autosnap due skipRsyncAutosnap in /etc/timeshift-autosnap.conf set to TRUE.
:: Processing package changes...
(1/1) reinstalling pip2pkgbuild                                                                                                               [#######################################################################################] 100%
warning: directory permissions differ on /home/user/
filesystem: 700  package: 755
:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Refreshing PackageKit...

Whether I run the following as the very next commands, or in a freshly sourced terminal instance, I can't find the executable.

$ which pypi2pkgbuild
pypi2pkgbuild not found
$ which pypi2pkgbuild.py
pypi2pkgbuild.py not found
$ which pip2pkgbuild
pip2pkgbuild not found
$ which pip2pkgbuild.py
pip2pkgbuild.py not found

I can successfully install the package with pip.

Installing with pip
$ python -m venv venv
$ source ./venv/bin/activate
$ pip freeze
$ which pip
/home/user/dev/2022-03-19_test/venv/bin/pip
$ pip --version
pip 22.0.4 from /home/user/dev/2022-03-19_test/venv/lib/python3.10/site-packages/pip (python 3.10)
$ which python
/home/user/dev/2022-03-19_test/venv/bin/python
$ python --version
Python 3.10.3
$ pip install pypi2pkgbuild --verbose
Using pip 22.0.4 from /home/user/dev/2022-03-19_test/venv/lib/python3.10/site-packages/pip (python 3.10)
Collecting pypi2pkgbuild
  Downloading pypi2pkgbuild-0.3.tar.gz (30 kB)
  Running command python setup.py egg_info
  WARNING: The wheel package is not available.
  WARNING: The wheel package is not available.
  WARNING: The wheel package is not available.
  WARNING: The wheel package is not available.
  running egg_info
  creating /tmp/pip-pip-egg-info-fuf71opp/pypi2pkgbuild.egg-info
  writing /tmp/pip-pip-egg-info-fuf71opp/pypi2pkgbuild.egg-info/PKG-INFO
  writing dependency_links to /tmp/pip-pip-egg-info-fuf71opp/pypi2pkgbuild.egg-info/dependency_links.txt
  writing requirements to /tmp/pip-pip-egg-info-fuf71opp/pypi2pkgbuild.egg-info/requires.txt
  writing top-level names to /tmp/pip-pip-egg-info-fuf71opp/pypi2pkgbuild.egg-info/top_level.txt
  writing manifest file '/tmp/pip-pip-egg-info-fuf71opp/pypi2pkgbuild.egg-info/SOURCES.txt'
  listing git files failed - pretending there aren't any
  reading manifest file '/tmp/pip-pip-egg-info-fuf71opp/pypi2pkgbuild.egg-info/SOURCES.txt'
  adding license file 'LICENSE.txt'
  writing manifest file '/tmp/pip-pip-egg-info-fuf71opp/pypi2pkgbuild.egg-info/SOURCES.txt'
  Preparing metadata (setup.py) ... done
Requirement already satisfied: pip>=10 in ./venv/lib/python3.10/site-packages (from pypi2pkgbuild) (22.0.4)
Requirement already satisfied: setuptools in ./venv/lib/python3.10/site-packages (from pypi2pkgbuild) (58.1.0)
Collecting wheel
  Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Using legacy 'setup.py install' for pypi2pkgbuild, since package 'wheel' is not installed.
Installing collected packages: wheel, pypi2pkgbuild
  changing mode of /home/user/dev/2022-03-19_test/venv/bin/wheel to 755
  Running command Running setup.py install for pypi2pkgbuild
  running install
  running build
  running build_scripts
  creating build
  creating build/scripts-3.10
  copying and adjusting pypi2pkgbuild.py -> build/scripts-3.10
  changing mode of build/scripts-3.10/pypi2pkgbuild.py from 644 to 755
  running install_egg_info
  running egg_info
  writing lib/pypi2pkgbuild.egg-info/PKG-INFO
  writing dependency_links to lib/pypi2pkgbuild.egg-info/dependency_links.txt
  writing requirements to lib/pypi2pkgbuild.egg-info/requires.txt
  writing top-level names to lib/pypi2pkgbuild.egg-info/top_level.txt
  listing git files failed - pretending there aren't any
  reading manifest file 'lib/pypi2pkgbuild.egg-info/SOURCES.txt'
  adding license file 'LICENSE.txt'
  writing manifest file 'lib/pypi2pkgbuild.egg-info/SOURCES.txt'
  Copying lib/pypi2pkgbuild.egg-info to /home/user/dev/2022-03-19_test/venv/lib/python3.10/site-packages/pypi2pkgbuild-0.3-py3.10.egg-info
  running install_scripts
  copying build/scripts-3.10/pypi2pkgbuild.py -> /home/user/dev/2022-03-19_test/venv/bin
  changing mode of /home/user/dev/2022-03-19_test/venv/bin/pypi2pkgbuild.py to 755
  writing list of installed files to '/tmp/pip-record-_314igvw/install-record.txt'
  Running setup.py install for pypi2pkgbuild ... done
[2022-03-19.log](https://github.com/anntzer/pypi2pkgbuild/files/8310339/2022-03-19.log)

Successfully installed pypi2pkgbuild-0.3 wheel-0.37.1
$ pip freeze
pypi2pkgbuild==0.3
$ which pypi2pkgbuild.py
/home/user/dev/2022-03-19_test/venv/bin/pypi2pkgbuild.py
$ pypi2pkgbuild.py --version
pypi2pkgbuild.py 0.3
$ which pypi2pkgbuild
pypi2pkgbuild not found

The package python-pypi2pkgbuild does appear in Octopi package manager, but in the shell which python-pypi2pkgbuild says not found.

Screenshot_20220319_195410

Attached log of full execution of the Arch-GNS3-Helper script.
2022-03-19.log

@SirToffski
Copy link
Owner

Hi,

Try with this package: https://aur.archlinux.org/packages/python-pypi2pkgbuild-git

I've just updated the script to build that package - hopefully it solves the issue.

$ yay -Syyy
$ yay -S python-pypi2pkgbuild-git

@maximberezin97
Copy link
Author

I think the problem is in the reference to the pypi2pkgbuild.py or python-pypi2pkgbuild-git or pip2pkgbuild package. It appears that after installing the package with the two yay commands you suggested, I cannot invoke the executable using some variations of the package name used in the script, particularly pip2pkgbuild. According to their usage notes one is supposed to use pypi2pkgbuild.py. It doesn't seem to me that pip2pkgbuild is installed in this script. Is this something unrelated to the pypi2pkgbuild.py package?

When I run the script as of commit 61f459f45654550933165b1d4ad05479d18b5d0a I get the following log.
2022-03-21.log

I can resolve the binary only in the following ways:

Command output
[user@hostname Arch-GNS3-Helper]$ which pypi2pkgbuild.py
/usr/bin/pypi2pkgbuild.py
[user@hostname Arch-GNS3-Helper]$ pypi2pkgbuild.py --version
pypi2pkgbuild.py 0.3.post5+g96f95c6
[user@hostname Arch-GNS3-Helper]$ pypi2pkgbuild.py --help
usage: pypi2pkgbuild.py [-h] [--version] [-v] [-o] [-u] [-i NAME,...] [-b BASE_PATH] [-f] [--pre] [-n PKGNAME] [-r PKGREL] [-g MAKEDEPENDS,...] [-s PYPI_NAME,...] [-t PKGTYPES] [-D] [-e PKGBUILD_EXTRAS] [-m MAKEPKG_OPTS] [-I]
                        [-p PACMAN_OPTS]
                        [name ...]

Create a PKGBUILD for a PyPI package and run makepkg.

positional arguments:
  name                  The PyPI package names. (default: None)

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  -v, --verbose         Log at DEBUG level. (default: False)
  -o, --outdated        Find outdated packages. (default: False)
  -u, --upgrade         Find and build outdated packages. (default: False)
  -i NAME,..., --ignore NAME,...
                        Comma-separated list of packages not to be upgrade. This flag can be passed multiple times; passing an empty flag ('-i=') can be used to strip out values passed so far. (default: ())
  -b BASE_PATH, --base-path BASE_PATH
                        Base path where the packages directories are created. (default: .)
  -f, --force           Overwrite a previously existing PKGBUILD. (default: False)
  --pre                 Include pre-releases. (default: False)
  -n PKGNAME, --pkgname PKGNAME
                        Force $pkgname. (default: None)
  -r PKGREL, --pkgrel PKGREL
                        Force value of $pkgrel (not applicable to metapackages). Set e.g. to 99 to override AUR packages. (default: 00)
  -g MAKEDEPENDS,..., --guess-makedepends MAKEDEPENDS,...
                        Comma-separated list of makedepends that will be guessed. Allowed values: cython, swig. (default: ('cython', 'swig'))
  -s PYPI_NAME,..., --setup-requires PYPI_NAME,...
                        Comma-separated list of setup_requires that will be forced. (default: ())
  -t PKGTYPES, --pkgtypes PKGTYPES
                        Comma-separated preference order for dists. (default: ('anywheel', 'sdist', 'manylinuxwheel'))
  -D, --no-deps         Don't generate PKGBUILD for dependencies. (default: True)
  -e PKGBUILD_EXTRAS, --pkgbuild-extras PKGBUILD_EXTRAS
                        Either contents of PKGBUILD_EXTRAS, or path to a patch directory (if a valid path). A patch directory should contain files of the form $pkgname.PKGBUILD_EXTRAS, which are used as PKGBUILD_EXTRAS. (default: )
  -m MAKEPKG_OPTS, --makepkg MAKEPKG_OPTS
                        Additional arguments to pass to `makepkg`. (default: --cleanbuild --nodeps)
  -I, --no-install      Don't install the built packages. (default: True)
  -p PACMAN_OPTS, --pacman PACMAN_OPTS
                        Additional arguments to pass to `pacman -U`. (default: )
[user@hostname Arch-GNS3-Helper]$ which pip2pkgbuild
which: no pip2pkgbuild in (/home/user/Applications/GNS3-Dev/venv/bin:/home/user/.asdf/shims:/opt/asdf-vm/bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin)
[user@hostname Arch-GNS3-Helper]$ python-pypi2pkgbuild-git
bash: python-pypi2pkgbuild-git: command not found
[user@hostname Arch-GNS3-Helper]$ which python-pypi2pkgbuild-git
which: no python-pypi2pkgbuild-git in (/home/user/Applications/GNS3-Dev/venv/bin:/home/user/.asdf/shims:/opt/asdf-vm/bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin)

I tried simply replacing pipi2pkgbuild with pypi2pkgbuild.py but the command arguments were unrecognized.

Truncated command output
+----------------------------------------+
Installing GNS3 dependencies
+----------------------------------------+

warning: qt5-svg-5.15.3+kde+r12-1 is up to date -- skipping
warning: qt5-websockets-5.15.3+kde+r3-1 is up to date -- skipping
warning: python-pip-21.0-1 is up to date -- skipping
warning: python-pyqt5-5.15.6-7 is up to date -- skipping
warning: python-sip4-4.19.25-3 is up to date -- skipping
warning: python-async_generator-1.10-7 is up to date -- skipping
warning: python-jinja-3.0.3-3 is up to date -- skipping
warning: python-distro-1.7.0-1 is up to date -- skipping
warning: python-jsonschema-3.2.0-6 is up to date -- skipping
warning: python-aiohttp-cors-0.7.0-7 is up to date -- skipping
 there is nothing to do
warning: git-2.35.1-1 is up to date -- skipping
 there is nothing to do
usage: pypi2pkgbuild.py [-h] [--version] [-v] [-o] [-u] [-i NAME,...]
                        [-b BASE_PATH] [-f] [--pre] [-n PKGNAME] [-r PKGREL]
                        [-g MAKEDEPENDS,...] [-s PYPI_NAME,...] [-t PKGTYPES]
                        [-D] [-e PKGBUILD_EXTRAS] [-m MAKEPKG_OPTS] [-I]
                        [-p PACMAN_OPTS]
                        [name ...]
pypi2pkgbuild.py: error: unrecognized arguments: 3.6.2
usage: pypi2pkgbuild.py [-h] [--version] [-v] [-o] [-u] [-i NAME,...]
                        [-b BASE_PATH] [-f] [--pre] [-n PKGNAME] [-r PKGREL]
                        [-g MAKEDEPENDS,...] [-s PYPI_NAME,...] [-t PKGTYPES]
                        [-D] [-e PKGBUILD_EXTRAS] [-m MAKEPKG_OPTS] [-I]
                        [-p PACMAN_OPTS]
                        [name ...]
pypi2pkgbuild.py: error: unrecognized arguments: 1.3.0
usage: pypi2pkgbuild.py [-h] [--version] [-v] [-o] [-u] [-i NAME,...]
                        [-b BASE_PATH] [-f] [--pre] [-n PKGNAME] [-r PKGREL]
                        [-g MAKEDEPENDS,...] [-s PYPI_NAME,...] [-t PKGTYPES]
                        [-D] [-e PKGBUILD_EXTRAS] [-m MAKEPKG_OPTS] [-I]
                        [-p PACMAN_OPTS]
                        [name ...]
pypi2pkgbuild.py: error: unrecognized arguments: 0.4.0
usage: pypi2pkgbuild.py [-h] [--version] [-v] [-o] [-u] [-i NAME,...]
                        [-b BASE_PATH] [-f] [--pre] [-n PKGNAME] [-r PKGREL]
                        [-g MAKEDEPENDS,...] [-s PYPI_NAME,...] [-t PKGTYPES]
                        [-D] [-e PKGBUILD_EXTRAS] [-m MAKEPKG_OPTS] [-I]
                        [-p PACMAN_OPTS]
                        [name ...]
pypi2pkgbuild.py: error: unrecognized arguments: 5.6.6
usage: pypi2pkgbuild.py [-h] [--version] [-v] [-o] [-u] [-i NAME,...]
                        [-b BASE_PATH] [-f] [--pre] [-n PKGNAME] [-r PKGREL]
                        [-g MAKEDEPENDS,...] [-s PYPI_NAME,...] [-t PKGTYPES]
                        [-D] [-e PKGBUILD_EXTRAS] [-m MAKEPKG_OPTS] [-I]
                        [-p PACMAN_OPTS]
                        [name ...]
pypi2pkgbuild.py: error: unrecognized arguments: 3.0.1
usage: pypi2pkgbuild.py [-h] [--version] [-v] [-o] [-u] [-i NAME,...]
                        [-b BASE_PATH] [-f] [--pre] [-n PKGNAME] [-r PKGREL]
                        [-g MAKEDEPENDS,...] [-s PYPI_NAME,...] [-t PKGTYPES]
                        [-D] [-e PKGBUILD_EXTRAS] [-m MAKEPKG_OPTS] [-I]
                        [-p PACMAN_OPTS]
                        [name ...]
pypi2pkgbuild.py: error: unrecognized arguments: 5.0.0

+----------------------------------------+
Preparing to install GNS3-server
+----------------------------------------+

install-gns3.sh: line 251: pip2pkgbuild: command not found

+----------------------------------------+
Installing GNS3-server
+----------------------------------------+

==> ERROR: PKGBUILD does not exist.

+----------------------------------------+
Installing GNS3-GUI
+----------------------------------------+

install-gns3.sh: line 271: pip2pkgbuild: command not found
==> ERROR: PKGBUILD does not exist.

+----------------------------------------+
Verifying the installation
+----------------------------------------+


  It appears the installation was either completed partially or has not been completed at all....

  Checking further
which: no python-gns3-gui in (/home/user/Applications/GNS3-Dev/venv/bin:/home/user/.asdf/shims:/opt/asdf-vm/bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin)

    GNS3-GUI was not installed...

    attempting to re-install
Cloning into 'gns3-gui'...
fatal: '/home/user/Applications/GNS3-Dev/gns3-server/gns3-gui' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ERROR: Invalid requirement: '/dev/null'
Hint: It looks like a path. The path does exist. The argument you provided (/dev/null) appears to be a requirements file. If that is the case, use the '-r' flag to install the packages specified within it.
ERROR: Invalid requirement: '/dev/null'
Hint: It looks like a path. The path does exist. The argument you provided (/dev/null) appears to be a requirements file. If that is the case, use the '-r' flag to install the packages specified within it.
ERROR:pypi2pkgbuild:Failed to obtain metadata for git+file:///home/user/Applications/GNS3-Dev/gns3-server/gns3-gui.
which: no python-gns3-server in (/home/user/Applications/GNS3-Dev/venv/bin:/home/user/.asdf/shims:/opt/asdf-vm/bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin)

    GNS3-server was not installed...

      attempting to re-install
Cloning into 'gns3-server'...
fatal: '/home/user/Applications/GNS3-Dev/gns3-server' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ERROR: Invalid requirement: '/dev/null'
Hint: It looks like a path. The path does exist. The argument you provided (/dev/null) appears to be a requirements file. If that is the case, use the '-r' flag to install the packages specified within it.
ERROR: Invalid requirement: '/dev/null'
Hint: It looks like a path. The path does exist. The argument you provided (/dev/null) appears to be a requirements file. If that is the case, use the '-r' flag to install the packages specified within it.
ERROR:pypi2pkgbuild:Failed to obtain metadata for git+file:///home/user/Applications/GNS3-Dev/gns3-server.
If you are using Gnome or Budgie, the script can make a launcher icon for you.
  1 = yes, 2 = no
2

  Done! Please remember to reboot your PC.

Hopefully this is simply an environment issue. I am new to Arch-like distros and would appreciate your help in troubleshooting.

@SirToffski
Copy link
Owner

SirToffski commented Mar 23, 2022

Heya! I've taken another look - it's been a while and to say the very least - script is a bit messy. I should probably re-write it to build all the packages in a clean chroot. That's a project for another day.

Long story short - pypi2pkgbuild was not required at all for this script. I've removed it completely. Instead, pip2pkgbuild should be used only.

I've done a test run and everything built and installed correctly. I've not had a chance to actually launch and test the GUI though.

Give it another go and let me know if any troubles.

@maximberezin97
Copy link
Author

maximberezin97 commented Mar 26, 2022

Hey, thanks for all your help! It appears that the changes since my last comment have indeed fixed the pypi2pkgbuild and pip2pkgbuild issues. I was able to run the install_gns3.sh script successfully and gns3 is now available in my PATH.

I am now experiencing a different issue, a ContextualVersionConflict regarding the Python package python-distro that we install here. The most recent release of distro is 1.7.0, however gns3-gui is pinned to require 1.6.0. When I run /usr/bin/gns3 I now get the following error:

Command output
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 573, in _build_master
    ws.require(__requires__)
  File "/home/user/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 891, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/home/user/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 782, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (distro 1.7.0 (/usr/lib/python3.10/site-packages), Requirement.parse('distro==1.6.0'), {'gns3-gui'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/gns3", line 33, in <module>
    sys.exit(load_entry_point('gns3-gui==2.2.31', 'gui_scripts', 'gns3')())
  File "/usr/bin/gns3", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 162, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3.10/site-packages/gns3/main.py", line 40, in <module>
    from gns3.utils.get_resource import get_resource
  File "/usr/lib/python3.10/site-packages/gns3/utils/get_resource.py", line 21, in <module>
    import pkg_resources
  File "/home/user/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3317, in <module>
    def _initialize_master_working_set():
  File "/home/user/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3291, in _call_aside
    f(*args, **kwargs)
  File "/home/user/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3329, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/home/user/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 575, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/home/user/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 588, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/home/user/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 777, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'distro==1.6.0' distribution was not found and is required by gns3-gui

Have you run into this? Could you please tell me what version of the python-distro package you have installed? Does pacman -Syu reproduce this issue in your environment? I do not yet see any issues in the gns3-gui repo to bump the dependency version of the distro module.

In my limited understanding which may be inaccurate, Arch's rolling release nature does not support version pinning in AUR. We could probably just pin the version using a requirements.txt file, but that would go against one of the goals of this script to manage all dependencies with the native Arch package manager.
Is there another way to resolve this that still involves managing the package with pacman and not pip?
Let me know if you prefer that I open a new ticket for this issue.

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

2 participants