Getting ERROR: Double requirement given: setuptools error in zappa

2024/9/21 19:13:08

I tried to deploy my Flask app with zappa==0.52.0, but I get an error as below;

ERROR: Double requirement given: setuptools (already in setuptools==52.0.0.post20210125, name='setuptools') WARNING: You are using pip version 20.2.3; however, version 21.1.3 is available. You should consider upgrading via the '/Users/yoonshinkwark/Documents/JBR_reco_local_2/JBR_reco_API_2/dola-aldagram/aws-flask38/bin/python3.8 -m pip install --upgrade pip' command. Oh no! An error occurred! :(

Traceback (most recent call last): File "/Users/yoonshinkwark/opt/anaconda3/lib/python3.8/site-packages/zappa/cli.py", line 3422, in handle sys.exit(cli.handle()) File "/Users/yoonshinkwark/opt/anaconda3/lib/python3.8/site-packages/zappa/cli.py", line 588, in handle self.dispatch_command(self.command, stage) File "/Users/yoonshinkwark/opt/anaconda3/lib/python3.8/site-packages/zappa/cli.py", line 630, in dispatch_command self.deploy(self.vargs["zip"], self.vargs["docker_image_uri"]) File "/Users/yoonshinkwark/opt/anaconda3/lib/python3.8/site-packages/zappa/cli.py", line 852, in deploy self.create_package() File "/Users/yoonshinkwark/opt/anaconda3/lib/python3.8/site-packages/zappa/cli.py", line 2760, in create_package venv=self.zappa.create_handler_venv(), File "/Users/yoonshinkwark/opt/anaconda3/lib/python3.8/site-packages/zappa/core.py", line 513, in create_handler_venv raise EnvironmentError("Pypi lookup failed") OSError: Pypi lookup failed

The version of Python is 3.8.8.

Answer

There is already an issue in the zappa github: https://github.com/zappa/Zappa/issues/995

The problem is that zappa adds setup-tools to its dependencies but the latest release of pip-tools (6.2.0) does the same now.

As a quick fix, you can pin pip-tools to version 6.1.0 in your requirements.txt

https://en.xdnf.cn/q/72010.html

Related Q&A

PySpark - Create DataFrame from Numpy Matrix

I have a numpy matrix:arr = np.array([[2,3], [2,8], [2,3],[4,5]])I need to create a PySpark Dataframe from arr. I can not manually input the values because the length/values of arr will be changing dyn…

RunTimeError during one hot encoding

I have a dataset where class values go from -2 to 2 by 1 step (i.e., -2,-1,0,1,2) and where 9 identifies the unlabelled data. Using one hot encode self._one_hot_encode(labels)I get the following error:…

Is there a Mercurial or Git version control plugin for PyScripter? [closed]

Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines. It is not currently accepting answers.We don’t allow questi…

How to make a color map with many unique colors in seaborn

I want to make a colormap with many (in the order of hundreds) unique colors. This code: custom_palette = sns.color_palette("Paired", 12) sns.palplot(custom_palette)returns a palplot with 12 …

Swap column values based on a condition in pandas

I would like to relocate columns by condition. In case country is Japan, I need to relocate last_name and first_name reverse.df = pd.DataFrame([[France,Kylian, Mbappe],[Japan,Hiroyuki, Tajima],[Japan,…

How to improve performance on a lambda function on a massive dataframe

I have a df with over hundreds of millions of rows.latitude longitude time VAL 0 -39.20000076293945312500 140.80000305175781250000 1…

How to detect if text is rotated 180 degrees or flipped upside down

I am working on a text recognition project. There is a chance the text is rotated 180 degrees. I have tried tesseract-ocr on terminal, but no luck. Is there any way to detect it and correct it? An exa…

Infinite loops using for in Python [duplicate]

This question already has answers here:Is there an expression for an infinite iterator?(7 answers)Closed 5 years ago.Why does this not create an infinite loop? a=5 for i in range(1,a):print(i)a=a+1or…

How to print the percentage of zipping a file python

I would like to get the percentage a file is at while zipping it. For instance it will print 1%, 2%, 3%, etc. I have no idea on where to start. How would I go about doing this right now I just have the…

kafka-python read from last produced message after a consumer restart

i am using kafka-python to consume messages from a kafka queue (kafka version 0.10.2.0). In particular i am using KafkaConsumer type. If the consumer stops and after a while it is restarted i would lik…