Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
moving python project to aws ec2
#1
I've got a python project that runs from a cron job.
It runs fine on the local machine, and I need it to run on an AWS EC2.
I copy it to the EC2 and run from the command line to test.

It throws this:
Error:
>Traceback (most recent call last): > File "BTCfeels.py", line 2, in <module> > from tweetfeels import TweetFeels > File "/home/john/anaconda3/lib/python3.5/site-packages/tweetfeels/__init__.py", line 1, in <module> > from .tweetdata import TweetData, TweetBin > File "/home/john/anaconda3/lib/python3.5/site-packages/tweetfeels/tweetdata.py", line 152 > df = df.groupby(pd.Grouper(freq=f'{int(binsize/second)}S')).size() > ^ >SyntaxError: invalid syntax
I tried to use the pip freeze method:

> pip freeze > requirements.txt
> then
> pip install -r requirements.txt

That throws this error:
Error:
> ERROR: Could not find a version that satisfies the requirement anaconda-project==0.8.0 (from -r requirements.txt (line 4)) (from versions: 0.8.1, 0.8.2) ERROR: No matching distribution found for anaconda-project==0.8.0 (from -r requirements.txt (line 4))
I just need to be able to run code that works on one ubuntu16.04 on another ubuntu16.04.

Thanks for any help.
Reply
#2
The code you try to run use f-string,then you need Python 3.6 -->.
You use Python 3.5.
>>> binsize = 10
>>> second = 5
>>> freq=f'{int(binsize/second)}S'
>>> freq
'2S'
Reply
#3
ubuntu 18.04 on AWS EC2 has Python 3.6.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020