# Setup.py: error: unrecognized arguments: egg\_info --egg-base /tmp/pip-pip-egg-info-nx929i7g

**URL:** <https://discuss.python.org/t/setup-py-error-unrecognized-arguments-egg-info-egg-base-tmp-pip-pip-egg-info-nx929i7g/14005>\
**Category:** Python Help\
**Tags:** help\
**Created:** [March 1, 2022, 5:26am UTC](https://discuss.python.org/t/setup-py-error-unrecognized-arguments-egg-info-egg-base-tmp-pip-pip-egg-info-nx929i7g/14005 "2022-03-01T05:26:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hongyi-zhao](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/hongyi-zhao/32/1981_2.png) [@hongyi-zhao](https://discuss.python.org/u/hongyi-zhao)\
**Post date:** [March 1, 2022, 5:26am UTC](https://discuss.python.org/t/setup-py-error-unrecognized-arguments-egg-info-egg-base-tmp-pip-pip-egg-info-nx929i7g/14005/1 "2022-03-01T05:26:22Z")

</div>

On Ubuntu 20.04.3 LTS, I try to create a virtualenv for [ariadne](https://github.com/hongyi-zhao/ariadne), but failed. For more details, see the following steps and errors:

```nohighlight
$ git clone https://github.com/hongyi-zhao/ariadne.git
$ cd ariadne

$ virtualenv venv
created virtual environment CPython3.8.10.final.0-64 in 244ms
  creator CPython3Posix(dest=/home/werner/Public/repo/github.com/hongyi-zhao/ariadne.git/venv, clear=False, global=False)
  seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, pkg_resources=latest, via=copy, app_data_dir=/home/werner/.local/share/virtualenv/seed-app-data/v1.0.1.debian.1)
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator

$ venv/bin/pip install -U pip
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting pip
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/6a/df/a6ef77a6574781a668791419ffe366c8acd1c3cf4709d210cb53cd5ce1c2/pip-22.0.3-py3-none-any.whl (2.1 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 20.0.2
    Uninstalling pip-20.0.2:
      Successfully uninstalled pip-20.0.2
Successfully installed pip-22.0.3

$ venv/bin/pip install -e .
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Obtaining file:///home/werner/Public/repo/github.com/hongyi-zhao/ariadne.git
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 2
  ╰─> [2 lines of output]
      usage: setup.py [-h] [-z] [-b] [-f]
      setup.py: error: unrecognized arguments: egg_info --egg-base /tmp/pip-pip-egg-info-nx929i7g
      [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.

```

Any hints for fixing this problem will be highly appreciated.

Regards,  
HZ

---

<div class="post-metadata">

**Author:** ![CAM-Gerlach](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/cam-gerlach/32/3688_2.png) [@CAM-Gerlach](https://discuss.python.org/u/CAM-Gerlach)\
**Post date:** [March 1, 2022, 5:43am UTC](https://discuss.python.org/t/setup-py-error-unrecognized-arguments-egg-info-egg-base-tmp-pip-pip-egg-info-nx929i7g/14005/2 "2022-03-01T05:43:45Z")

</div>

First, make sure you activate your environment with `source venv/bin/activate` (assuming the structure is the same as with the stdlib `venv`, then update pip and try your install command again. If it still doesn’t work, as you can see from the error messages,

> [@hongyi-zhao](#):
>
> ```auto
> note: This is an issue with the package mentioned above, not pip.
> hint: See above for details.
> 
> ```

and

> [@hongyi-zhao](#):
>
> ` note: This error originates from a subprocess, and is likely not a problem with pip.`

The issue is likely not with pip, but with the configuration (perhaps in the `setup.py`, `setup.cfg` or `pyproject.toml`) of the package you’re trying to install.

---

<div class="post-metadata">

**Author:** ![frostming](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/frostming/32/326_2.png) [@frostming](https://discuss.python.org/u/frostming)\
**Post date:** [March 1, 2022, 6:21am UTC](https://discuss.python.org/t/setup-py-error-unrecognized-arguments-egg-info-egg-base-tmp-pip-pip-egg-info-nx929i7g/14005/3 "2022-03-01T06:21:39Z")

</div>

The project has a handcrafted `setup.py`, not the one `pip install` expects and it doesn’t accept arguments `pip` thinks it should.

To make a package `pip install`'able, please follow the [packaging guide](https://packaging.python.org/en/latest/tutorials/packaging-projects/).

---

<div class="post-metadata">

**Author:** ![hongyi-zhao](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/hongyi-zhao/32/1981_2.png) [@hongyi-zhao](https://discuss.python.org/u/hongyi-zhao)\
**Post date:** [March 1, 2022, 7:35am UTC](https://discuss.python.org/t/setup-py-error-unrecognized-arguments-egg-info-egg-base-tmp-pip-pip-egg-info-nx929i7g/14005/4 "2022-03-01T07:35:03Z")

</div>

@frostming Is there a quick fix for this problem?

HZ

---

<div class="post-metadata">

**Author:** ![abravalheri](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/abravalheri/32/4990_2.png) [@abravalheri](https://discuss.python.org/u/abravalheri)\
**Post date:** [March 1, 2022, 8:06am UTC](https://discuss.python.org/t/setup-py-error-unrecognized-arguments-egg-info-egg-base-tmp-pip-pip-egg-info-nx929i7g/14005/5 "2022-03-01T08:06:04Z")

</div>

You need to pickup a build backend and then follow their instructions. For example in your `setup.py` you seem to already have some code for setuptools, so you can decide to uncomment that bit.

However the customised install that modifies the user home directories is not something any backend supports (to be my best knowledge). So I would implement that as a second installation step asking the user to run a CLI command you provide in your package (e.g. `ariadne install`).

To add such command you can use a [`console_scripts` entry-point](https://setuptools.pypa.io/en/latest/userguide/quickstart.html#entry-points-and-automatic-script-creation).

As recommended by Frostming, please have a look on the Packaging tutorial, the structure of the package is fairly unconventional and it might not play well with the other Python tools, such as pip.

---

<div class="post-metadata">

**Author:** ![hongyi-zhao](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/hongyi-zhao/32/1981_2.png) [@hongyi-zhao](https://discuss.python.org/u/hongyi-zhao)\
**Post date:** [March 9, 2022, 12:08pm UTC](https://discuss.python.org/t/setup-py-error-unrecognized-arguments-egg-info-egg-base-tmp-pip-pip-egg-info-nx929i7g/14005/6 "2022-03-09T12:08:04Z")

</div>

Thank you all for your help. Finally, the following steps solve this problem using this [setup.py](https://github.com/mooz/percol/blob/master/setup.py):

```nohighlight
$ git clone https://github.com/hongyi-zhao/ariadne.git
$ cd ariadne
$ virtualenv venv 
$ venv/bin/pip install -U pip
$ venv/bin/pip install -e .

```

Regards,  
HZ
