I’m getting an error when ever I run this python program that I got from github.
When I do ./filename, it says that it no longer supports python 2
But when I type in python3, this pops up
Error importing: pycurl lib.
To install it on Debian based systems:
$ ‘sudo apt-get install python3-pycurl’
any suggestions?
2
Answers
Figured it out.
Yay!
Okay, so normally what happens when you type “import someLibrary” into Python, is that it looks around in the place on your computer where Python stores libraries. So, what’s happened here is that Python has tried to look on your computer to find ‘pycurl-lib’, but it isn’t there, because not all libraries can be stored in the base version of Python.
When you type ‘import requests’, for example, you won’t have this problem, because Python includes that library when you originally install it. However, since this library doesn’t come with Python, your computer has to get it from somewhere on the internet (much like how you got your program from Github.) On Linux, a command that will do this for you is ‘apt-get install python3-pycurl’.
The commands that will do this for you vary from Operating System to Operating System, so if you aren’t on Linux, you’ll need to look up ‘command for installing Python libraries on [your operating system here]’