Anyjson设置中的错误命令:USE_2TO3无效

发布于 2025-02-01 22:08:28 字数 1201 浏览 3 评论 0原文

#25 3.990   × python setup.py egg_info did not run successfully.
#25 3.990   │ exit code: 1
#25 3.990   ╰─> [1 lines of output]
#25 3.990       error in anyjson setup command: use_2to3 is invalid.
#25 3.990       [end of output]

这是一个常见的错误,最常见的解决方案是将setuptools降低到58版。这对我不起作用。我尝试安装Python3-anyjson,但这也不起来。我完全不知所措。任何建议或帮助都将非常感谢。

如果很重要:此应用程序是传统意大利面条,我正在尝试将其抛光以进行迁移。没有任何形式的文件。

需求.txt如下:

cachetools>=2.0.0,<4
certifi==2018.10.15
Flask-Caching
Flask-Compress
Flask==2.0.3
cffi==1.2.1
diskcache
earthengine-api==0.1.239
gevent==21.12.0
google-auth>=1.17.2
google-api-python-client==1.12.1
gunicorn==20.1.0
httplib2.system-ca-certs-locater
httplib2==0.9.2
oauth2client==2.0.1
pyasn1-modules==0.2.1
redis
requests==2.18.0
werkzeug==2.1.2
six==1.13.0
pyasn1==0.4.1
Jinja2==3.1.1
itsdangerous==2.0.1


Flask-Celery-Helper
Flask-JWT==0.2.0
Flask-Limiter
Flask-Mail
Flask-Migrate
Flask-Restless==0.16.0
Flask-SQLAlchemy
Flask-Script
Flask-Testing
Flask==2.0.3
Pillow<=6.2.2
Shapely
beautifulsoup4
boto
celery==3.1.23
geopy
gevent==21.12.0
numpy<1.17
oauth2client==2.0.1
passlib
psycopg2
pyproj<2
python-dateutil==2.4.1
scipy
#25 3.990   × python setup.py egg_info did not run successfully.
#25 3.990   │ exit code: 1
#25 3.990   ╰─> [1 lines of output]
#25 3.990       error in anyjson setup command: use_2to3 is invalid.
#25 3.990       [end of output]

This is a common error which the most common solution to is to downgrade setuptools to below version 58. This was not working for me. I tried installing python3-anyjson but this didn't work either. I'm at a complete loss.. any advice or help is much appreciated.

If it matters: this application is legacy spaghetti and I am trying to polish it up for a migration. There's no documentation of any kind.

The requirements.txt is as follows:

cachetools>=2.0.0,<4
certifi==2018.10.15
Flask-Caching
Flask-Compress
Flask==2.0.3
cffi==1.2.1
diskcache
earthengine-api==0.1.239
gevent==21.12.0
google-auth>=1.17.2
google-api-python-client==1.12.1
gunicorn==20.1.0
httplib2.system-ca-certs-locater
httplib2==0.9.2
oauth2client==2.0.1
pyasn1-modules==0.2.1
redis
requests==2.18.0
werkzeug==2.1.2
six==1.13.0
pyasn1==0.4.1
Jinja2==3.1.1
itsdangerous==2.0.1


Flask-Celery-Helper
Flask-JWT==0.2.0
Flask-Limiter
Flask-Mail
Flask-Migrate
Flask-Restless==0.16.0
Flask-SQLAlchemy
Flask-Script
Flask-Testing
Flask==2.0.3
Pillow<=6.2.2
Shapely
beautifulsoup4
boto
celery==3.1.23
geopy
gevent==21.12.0
numpy<1.17
oauth2client==2.0.1
passlib
psycopg2
pyproj<2
python-dateutil==2.4.1
scipy

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

很酷又爱笑 2025-02-08 22:08:29

如果在降级setuptools之后继续遇到错误,请确保安装了车轮:

pip install "setuptools<58.0.0" wheel

更新(2023-11-02):由于Brian Peterson和Aaron的推荐,将删除Anyjson。

If keep getting the error after downgrading setuptools, make sure to have installed wheel:

pip install "setuptools<58.0.0" wheel

UPDATE (2023-11-02): anyjson was removed thanks to Brian Peterson and Aaron recommendation.

梦在夏天 2025-02-08 22:08:29

安装低于58.0.0的setuptools版本解决了问题。

pip install "setuptools<58.0.0" 

之所

Installing a version of setuptools lower than 58.0.0 solved the issue.

pip install "setuptools<58.0.0" 

It happens because Use_2to3 has been removed from setuptools >=58.0.0 versions

幽蝶幻影 2025-02-08 22:08:29
pip install "setuptools<58.0.0" wheel --no-cache-dir

之后

pip install django-celery

在我的电脑上工作!

pip install "setuptools<58.0.0" wheel --no-cache-dir

and after that

pip install django-celery

worked on my pc!

美人迟暮 2025-02-08 22:08:29

我试图运行推荐的解决方案,并且由于某种原因而失败。我能够安装anyjson这样:

  • 下载tar.gz:curl -o https://files.pythonhosted.org/packages/c3/c3/c3/d4089e1a3e1a3dd255b46beb55555a92b0797cfffffffffffffffff。 3.3 。
  • ​sha256sum - 检查
  • 提取tar.gz:tar zxvf anyjson-0.3.3.3.3.3.3.tar.gz
  • 运行 2to3 在提取的dir:2to3 -w anyjson-0.3.3
  • pip pip install:pip intern anyjson-0.3.33 /

I tried to run the recommended solutions and all failed for one reason or another. I was able to install anyjson like this:

  • Download tar.gz: curl -O https://files.pythonhosted.org/packages/c3/4d/d4089e1a3dd25b46bebdb55a992b0797cff657b4477bc32ce28038fdecbc/anyjson-0.3.3.tar.gz
  • Verify checksum: echo '37812d863c9ad3e35c0734c42e0bf0320ce8c3bed82cd20ad54cb34d158157ba anyjson-0.3.3.tar.gz' | sha256sum --check
  • Extract tar.gz: tar zxvf anyjson-0.3.3.tar.gz
  • Run 2to3 on the extracted dir: 2to3 -w anyjson-0.3.3
  • Pip install: pip install anyjson-0.3.3/
断桥再见 2025-02-08 22:08:29

升级PIP对我有用

pip install -upgrade pip

Upgrading pip is what worked for me

pip install --upgrade pip

倾其所爱 2025-02-08 22:08:28

降级setuptools对我有用

pip install "setuptools<58.0.0"

,然后

pip install django-celery

Downgrading setuptools worked for me

pip install "setuptools<58.0.0"

And then

pip install django-celery
新人笑 2025-02-08 22:08:28

安装SetUptools 57.5.0对我解决了相同的问题。

pip install setuptools~=57.5.0

Installing setuptools 57.5.0 solved the same issue for me.

pip install setuptools~=57.5.0
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文