News for hackers. Stuff that matters.
Re:This Is What Python Beginners Have to Deal With by thewhitetulip on Thursday September 08, 2016 @05:57AM (#12451607)
>Installing libraries

I think pip and easy_install solves this problem. Or did I read the point incorrectly?

>docs are horrible

Also I never had seen the JS documentation of Mozilla, it is just beautiful. I have been using Python without any documentation related problems for that time, I actually am fond of Python documentation, for some reason it struck a chord with me.

The thing is, I learned Python by using the docs as the starting point, studied the tutorial and later the standard library, never really had a problem sorting through the docs ever. For everything there is a global module index, go to the a-z, click on a, go to the respective class/function and it has a good example, at least for the stdlib

I love Go language's docs more though.

Re:This Is What Python Beginners Have to Deal With by richardwhiuk on Thursday September 08, 2016 @06:08AM (#12451652)
Try "pip install pycurl". It'll fail. The solution is to install a C compiler and (on Ubuntu) run apt-get install libcurl4-openssl-dev. That's very different to other languages - they don't expect you to have a bunch of different development environments.
Re:This Is What Python Beginners Have to Deal With by Illniyar on Thursday September 08, 2016 @06:45AM (#12451787)
That's not really true, lots of languages requires certain modules to be built from source with a C compiler.

Ruby and Node.js comes to mind.

Though in general the community behind them do a much better job of hiding this complexity from the user - to the point that most times you don't realize you've compiled it from source.

Re:This Is What Python Beginners Have to Deal With by anaphor on Thursday September 08, 2016 @10:41PM (#12459325)
Worked fine for me (I had never used it before). Perhaps the problem is with your OS? Learning how to install dependencies should be one of the first things a programmer learns. I don't think it's unreasonable to learn that a message like "Error: X requires this library! Failed to install" means you should go and install that library. Plus it can be frustrating when something comes with its own version of a certain library because it makes tracking down bugs more difficult. For example Python ships its own version of libffi (the library it uses to call C functions). I've had issues with this library before, and it turned out the Python devs hadn't bothered to update it in a long time, because it "worked", but it didn't for me, and the newer version worked fine. So I had to end up trying to rebuild Python from source with a more up-to-date version of libffi, which was a giant pain. It may be "easier" to make everything self-contained like that, but it causes headaches too. Maybe it would be better in those cases if the library were just packaged in the distro's package manager? (Or brew for Macs). That would allow for more complete dependency handling.
Re:This Is What Python Beginners Have to Deal With by thewhitetulip on Thursday September 08, 2016 @06:15AM (#12451683)
taking a quick look at the issue

the website says

PycURL is a Python interface to libcurl. and that would mean that we need libcurl installed. I am sure this is true with any other language as well, since this is a linker library, if that's a word.

also, surprisingly the website didn't mention that you need to install the libcurl4-openssl-dev :-)

so something is broken on this package.

Again, this is a package issue and not the issue of the language. We can find such examples in all languages. Doesn't mean Python's package system is broken or the language is broken.

I am waiting when the author will start teaching Go! just to read his "Problems everyone faces learning Go".

Re:This Is What Python Beginners Have to Deal With by nl on Thursday September 08, 2016 @06:46AM (#12451791)
PycURL is a Python interface to libcurl. and that would mean that we need libcurl installed. I am sure this is true with any other language as well, since this is a linker library, if that's a word.

But this is just an example of the type of thing that is typical in Python using pip.

Anaconda is a bit better (see [1] for the details) but it is a real problem. It isn't uncommon to resort to Docker to work around this.

Pretending this isn't a problem for beginners (and even comparatively advanced users) isn't helpful.

[1] https://www.continuum.io/blog/developer-blog/python-packages...

Re:This Is What Python Beginners Have to Deal With by thewhitetulip on Thursday September 08, 2016 @07:31AM (#12452040)
I am curious, how do these libraries work for other languages, for instance Java interface to curl, how do they work around that fact?

This can be put forward as a PEP, I am not undermining the issue.

Re:This Is What Python Beginners Have to Deal With by nl on Thursday September 08, 2016 @12:31PM (#12454521)
I am curious, how do these libraries work for other languages, for instance Java interface to curl, how do they work around that fact?

They typically ship a private precompiled library and link to without using the system LD_LIBRARY_PATH (or whatever).

Anaconda gets this mostly right - they ship precompiled libraries, but I'm not sure what the do with the linking situation.

This can be put forward as a PEP, I am not undermining the issue.

That isn't the most useful response for a beginner programmer.

Re:This Is What Python Beginners Have to Deal With by thewhitetulip on Thursday September 08, 2016 @01:05PM (#12454846)
exactly how many such precompiled libs do other languages ship?

pycurl etc.is not a part of stdlib, python or pip is not broken, this package's install mech could be broken

>That isn't the most useful response for a beginner programmer.

it was not for them, it was for those who are willing for a change and think this is a legitimate problem, jmdownvoting me win't make me shut up or solve the problem!

we can ask for a PEP since python is an Open Source project, noy sure if the author of this post tried that approach