What to add in the requirements.txt for Heroku uploading - python

I've been looking into the requirement.txt purpose through the Heroku website, but I've never understood what to truly add into that text file. I'm trying to host a bot using discord and the only thing I installed using pip install ... was selenium, discord. I understand it is the pip install package, but I see other people on youtube adding their git in it and such. Can someone help me understand this further so I can successfully upload a bot! Thank you!

Try putting these in requirements.txt:
git+https://github.com/Rapptz/discord.py
dnspython==1.16.0
PyNaCl==1.3.0
async-timeout==3.0.1
Also, make sure your txt file is named requirements (without .txt`)

Related

having problem upgrading 5 year old django project

i am trying to use pip freeze > requirements.txt file and in my requirements.txt. i see HUL written between every word and version there. please help
i don't know what to try google not helping much
Try pipreq
pip install pipreq
To generate requiremnts file
pipreqs>requirements.txt

How can I make this script run

I found this script (tutorial) on GitHub (https://github.com/amyoshino/Dash_Tutorial_Series/blob/master/ex4.py) and I am trying to run in my local machine.
Unfortunately I am having and Error
I would really appreciate if anyone can help me to run this script.
Perhaps this is something easy but I am new in coding.
Thank you!
You probably just need to pip install the dash-core-components library!
Take a look at the Dash Installation documentation. It currently recommends running these commands:
pip install dash==0.38.0 # The core dash backend
pip install dash-html-components==0.13.5 # HTML components
pip install dash-core-components==0.43.1 # Supercharged components
pip install dash-table==3.5.0 # Interactive DataTable component (new!)
pip install dash-daq==0.1.0 # DAQ components (newly open-sourced!)
For more info on using pip to install Python packages, see: Installing Packages.
If you have run those commands, and Flask still throws that error, you may be having a path/environment issue, and should provide more info in your question about your Python setup.
Also, just to give you a sense of how to interpret this error message:
It's often easiest to start at the bottom and work your way up.
Here, the bottommost message is a FileNotFound error.
The program is looking for the file in your Python37/lib/site-packages folder. That tells you it's looking for a Python package. That is the directory to which Python packages get installed when you use a tool like pip.

Use OpenCV on deployed Flask app (Heroku)

Hello I seem to be having trouble importing opencv on my deployed flask app on Heroku!
I've referred to similar posts such as this this
"ImportError: libSM.so.6: cannot open shared object file: No such file or directory " but can't seem to figure out the next steps on windows.
This is what I've done so far:
1. gone to Heroku -> App -> Settings -> Buildpacks -> added Python buildpack
2. Added a Aptfile.txt to my directory with the following packages on each line (read this somewhere not sure if it makes any sense)
libsm6 , libxrender1 ,libfontconfig1, libice6
Notes:
My openCV version-- opencv-python==3.4.3.18
I'm on windows so the sudo commands recommended in the other post answers dont work
Thanks in advance!
Use opencv-python-headless it's out of libSM6 dependency.
pip install opencv-python-headless
put this line in requirments.txt
opencv-python-headless==4.2.0.32

Installing SerpentAI error

I'm trying to install SerpentAI, and I've followed the steps word for word (except the Redis one), but I keep getting this error.
I think it's because I didn't install Redis, but I don't know how to do that. I downloaded it from GitHub, but I'm not sure what to do with it.
Here's a link to the documentation I was following, if it helps. I was right at the "run pip install serpentai"
Thanks so much!

Installing PRAW

I would like to install PRAW so I can make reddit bots and stuff, but all the install guides are confusing to me so could someone explain how to as noob friendly as possible. I've had some experience with vanilla python. Thanks!
praw is best installed, according to the documentation, via pip. To install pip, you need setuptools. Here is a simple guide on installing pip via setuptools.
Basically, download ez_setup.py and get-pip.py, two Python scripts that automatically get and install setuptools and pip. You'll want to run the following commands in the terminal in the same directory as the location of the files, in order:
python ez_setup.py
python get-pip.py
Finally, you'll want to use pip to get praw. pip is an executable file that is usually located in your python build directory. For example, in Windows, it's located in C:\Python27\scripts. You can add that directory to your system path variable, but right now you can just navigate to that directory where pip.exe is installed. Then, run the following command in the terminal:
pip install praw
I recently had trouble with this so I thought I would add what I did.
Install Pip - https://pip.pypa.io/en/stable/installing/
install praw pip install praw; This is done on your pc/mac/linux(?)
Installation guide
Register on reddit as a developer and register the app. To be able to use the api you need to have a client_id and a client_secret. Get those by registering here. More information about the types of applications can be found here.
Now you are ready to begin coding. This is a good script to verify that you are connecting to the reddit api. The client_id and client_secret are from the previous step and the user_agent is a string that is unique to your app. I used something like 'my first app by /u/myUsername'. The password and username is your reddit login
Run this code and it should output your username.
import praw
reddit = praw.Reddit(client_id='CLIENT_ID',
client_secret="CLIENT_SECRET", password='PASSWORD',
user_agent='USERAGENT', username='USERNAME')
print(reddit.user.me())

Categories