requirements.txt can be commented out with #

When developing a WEB API that runs on Elastic Beanstalk on AWS, [you need to use Python 3.4, which is a slightly older version](http://docs.aws.amazon.com/ja_jp/elasticbeanstalk/latest/ dg / create-deploy-python-container.html).

And this time, I encountered a situation where there is a library that works properly in Python 3.6, but does not work in 3.4 unless you specify the version in detail.

Therefore, when I investigated how to comment out to make a note of the information "Why are you not using the latest version" in `requirements.txt```, it is OK with` `#` as in Python itself. was.

...
ply==3.8
# Python3.4 fails to import the latest version
protobuf==3.2.0rc2                                               
pyasn1==0.3.3
...

I found it in this description. Normally, it is automatically generated by pip freeze> requirements.txt, so it seems that there are not many opportunities to write comments.

https://github.com/pypa/pip/issues/564

A line beginning with # is treated as a comment and ignored, so you can just place your comment on the line above instead of on the same line.

This is the end of the subject of this article, but I am not convinced that the behavior itself that "it does not work unless you specify the version in detail in 3.4", so I will investigate it once it is ready to work.

Specifically, in Python 3.4, an error occurs in importing 3.4.0 of `` `protobuf``` library, so 3.2. I had to use 0rc2 (even the versions before and after that didn't work).

  File "/home/ninomiyt/eb-virt/local/lib/python3.4/site-packages/google/cloud/client.py", line 26, in <module>
    from google.cloud._helpers import _determine_default_project
  File "/home/ninomiyt/eb-virt/local/lib/python3.4/site-packages/google/cloud/_helpers.py", line 33, in <module>
    from google.protobuf import duration_pb2
ImportError: No module named 'google.protobuf'

Normally, it would be cool to be able to write an article after identifying the cause of the error and sending a pull request (or raising an issue), but for the time being, giving priority to releasing and finishing the work.

Recommended Posts

requirements.txt can be commented out with #
Until youtube-dl can be used with Synology (DS120j)
File types that can be used with Go
List packages that can be updated with pip
Japanese can be used with Python in Docker environment
Color list that can be set with tkinter (memorial)
Python knowledge notes that can be used with AtCoder
Limits that can be analyzed at once with MeCab
NumPy zeros can be defined even with a size of 0
pd.tseries.offsets.DateOffset can be quite slow if not used with caution
SSD 1306 OLED can be used with Raspberry Pi + python (Note)
I investigated the pretreatment that can be done with PyCaret
Let's make a diagram that can be clicked with IPython
When developing with ipython, scrapy can no longer be read
Maybe it can be recursed
[Python] Make a graph that can be moved around with Plotly
Until torch-geometric can be used only with Windows (or Mac) CPU
Make a Spinbox that can be displayed in Binary with Tkinter
I made a shuffle that can be reset (reverted) with Python
Make a currency chart that can be moved around with Plotly (2)
Comparison of 4 styles that can be passed to seaborn with set_context
Make a Spinbox that can be displayed in HEX with Tkinter
Make a currency chart that can be moved around with Plotly (1)