#python

How To Efficiently Read Set Lines of Range in Text File

by

In order to crawl a large text file containing URLs, I required a method that would allow me to specify and read only a certain range of lines, without having to load the entire file into memory. To achieve this, I utilized the islice() function from Python's itertools module: itertools.islice()

Here is a code snippet that demonstrates this:

CONTINUE READING

No Matching Distribution Found for Botocore: AWSEBCLI

by

I have been ignoring the message to upgrade awsebcli tool for long time. This time I did not ignore and made an attempt to upgrade:


pip install --upgrade awsebcli
I got an error:


No matching distribution found for botocore<1.22.0,>=1.21.0 (from awsebcli)

There was also a little warning asking me to consider upgrading my existing pip installation. I upgraded pip with simple command.

pip install --upgrade pip --user
I made fresh attempt to upgrade awsebcli. I got same error telling me “No matching distribution found” I found a suggestion in forum to try installing specific verion of awsebcli to overwrite current installation version. I did that:

sudo pip install --upgrade awsebcli botocore==1.19.63
I force upgraded to 1.19.63 which was still way higher than my existing version of awsebcli. It did installed successfully but also gave few errors:


ERROR: pip's legacy dependency resolver does not consider dependency conflicts when selecting packages. This behaviour is the source of the following dependency conflicts.
boto3 1.7.68 requires botocore<1.11.0,>=1.10.68, but you'll have botocore 1.19.63 which is incompatible.
awsebcli 3.20.2 requires botocore<1.22.0,>=1.21.0, but you'll have botocore 1.19.63 which is incompatible.

You might also like: HTTPS not working on AWS Elastic Beanstalk

It installed with errors. I verified installation by deploying my new update to beanstalk environment to see if awsebcli tool is working fine. It did not. I got this error:



File “/usr/local/bin/eb”, line 5, in 
    from ebcli.core.ebcore import main
  File “/Library/Python/2.7/site-packages/ebcli/core/ebcore.py”, line 19, in 
    from ebcli.core import ebglobals, base, hooks
  File “/Library/Python/2.7/site-packages/ebcli/core/hooks.py”, line 20, in 
    from ebcli.core import fileoperations
  File “/Library/Python/2.7/site-packages/ebcli/core/fileoperations.py”, line 32, in 
    from json import load, JSONDecodeError
ImportError: cannot import name JSONDecodeError

Solution:

CONTINUE READING

Recommended posts