On Tue, Jan 6, 2015 at 2:00 PM, Aaron Meurer <[email protected]> wrote:
>
>
> On Tue, Jan 6, 2015 at 1:38 PM, Joachim Durchholz <[email protected]> wrote:
>>
>> tl;dr: Sergey's "unbundle mpmath" patches have created a substantial entry
>> barrier for GSoC students (and people with similar low Python experience),
>> and complicated the process of starting a debugging or test session.
>> Also, I'm pretty p*ssed because I predicted exactly this, and got some
>> dismissive non-answers instead of seeing the issues addressed.
>>
>>
>> Full story:
>>
>>
>> I have to say that my fears have fully become reality: The process of
>> installing mpmath, while simple, isn't described in a way that "just works",
>> and still invites subtle error.
>>
>> As a developer, I expect to be able to download the git repo and start
>> working. Possibly after reading a README file.
>>
>> Okay, let's see how a new dev with little knowledge of Python and no
>> knowledge of SymPy would fare...
>>
>> * README.rst is available. Fair enough.
>>
>> * It says "git clone" - okay, I just did that.
>>
>> * It sends me to http://docs.sympy.org/dev/install.html - erh, a detour.
>> Let's put that aside, I haven't fully read the readme and don't even know
>> yet that anything is missing.
>
>
> Clearly this document needs to be updated.
>
>>
>>
>> * Okay, "Documentation and Usage", that sounds promising.
>> Says "Everything is at" and another URL - also instructions for generating
>> docs locally: cd docs; make html
>> Oh. I'm getting this:
>>
>> Makefile:121: warning: overriding commands for target
>> `_build/cheatsheet/cheatsheet.pdf'
>> Makefile:116: warning: ignoring old commands for target
>> `_build/cheatsheet/cheatsheet.pdf'
>> rm -rf _build/logo
>> mkdir -p _build/logo
>> python ./generate_logos.py -d
>> INFO:root: File saved: ./_build/logo/sympy-notail.svg
>> INFO:root: File saved: ./_build/logo/sympy-notailtext.svg
>> INFO:root: File saved: ./_build/logo/sympy-notext.svg
>> ERROR:root:rsvg-convert: command not found
>> make: *** [logo] Error 127
>>
>> OK, that's "just a detour" because I'm really after mpmath, not html, and
>> I was able to ask Ubuntu what package I needed to get installed. However,
>> this would add to the problems a new dev would have to overcome; maybe it's
>> a good idea to list rsvg-convert among the required installs in the
>> documentation building docs.
>>
>>
>> The same goes for convert (from imagemagick).
>>
>> I'm giving up at sphinx-build since it does not have a Debian package.
>> I suppose I can easily install it via a Python installer, a newbie might
>> not know that.
>
>
> The docs require a handful of things to build actually. We should document
> this. sphinx-build is just part of sphinx.
>
>>
>>
>> So... no local docs, skipping that section. (Also, getting a bit
>> frustrated.)
>> (Taking off my newbie hat, I also didn't want to pursue that detour
>> further. Maybe somebody else has more interest in getting the docs building
>> instructions back on track.)
>>
>> * Now the "Usage" part of "Documentation and Usage"
>> It says I should just start python and run a few import statements.
>> ... aaand I'm getting this:
>>
>> $ python
>> Python 2.7.6 (default, Mar 22 2014, 22:59:56)
>> [GCC 4.8.2] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> from sympy import Symbol, cos
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in <module>
>>   File "sympy/__init__.py", line 37, in <module>
>>     from .core import *
>>   File "sympy/core/__init__.py", line 8, in <module>
>>     from .expr import Expr, AtomicExpr
>>   File "sympy/core/expr.py", line 7, in <module>
>>     from .evalf import EvalfMixin, pure_complex
>>   File "sympy/core/evalf.py", line 9, in <module>
>>     import mpmath.libmp as libmp
>> ImportError: No module named mpmath.libmp
>>
>> So okay, I bet the instructions are elsewhere, but somebody who just walks
>> down the README.rst is hosed.
>>
>> As expectation had it, bin/isympy would fail with exactly the same error.
>
>
> Maybe we should import mpmath at the top of sympy/__init__.py and raise an
> ImportError with a better message.
>
>>
>>
>> * Oh, *now* there's an "Installation" section!
>>
>> * python setup.py install
>> Which gives me this:
>>
>> running install
>> error: can't create or remove files in install directory
>>
>> The following error occurred while trying to add or remove files in the
>> installation directory:
>>
>>     [Errno 13] Permission denied:
>> '/usr/local/lib/python2.7/dist-packages/test-easy-install-15567.write-test'
>>
>> There's a long explanation and a link... but it does not explain what to
>> do with a "permission denied" situation. Luckily, I know that virtualenv
>> helps (but it's still a pain because virtualenv is a pain for me, somehow
>> I'm not finding a good way to set up shortcuts so I'm still forced to type a
>> whole lot of incantations in each new shell window just to get into the
>> virtualenv).
>>
>> Still. I'm not after almost 100 lines of writeup, with several problems
>> along the way.
>> Sergey said "it's easy" and "you should do your reading". Well, I did and
>> it still isn't, it took me more than an hour to try all these things.
>> Compared to the way before the unbundling, it's a big step backwards. I
>> could simply download git repo, start bin/isympy or bin/test, and it all
>> worked out of the box; now I have an odysseus tour through various
>> procedures and problems (the writeup now nearing the 100-line mark), I have
>> to know virtualenv, I have to organize my shortcuts, before I can start
>> hacking... Sergey, this wasn't the finest thing to do, particularly for a
>> change that never had a clear motive (except making life easier for
>> packagers - heck no, sympy was standalone and worked well with that, and if
>> somebody really ran into a library conflict, then, well, the conflict
>> wouldn't go away by unbundling anyway, so what was the point???)
>>
>> Yeah, sorry for the rant.
>> I'm not saying that unbundling libraries was misguided.
>> But I'm really questioning the wisdom of unbundling the most critical
>> library first. We should have done this with some other dependency. pep8.py
>> comes to mind - it's not needed for running SymPy, and the tests that it is
>> useful for are entirely optional, so that would have been a good testbed for
>> trying out packaging and stuff.
>>
>> Ah well. Dropped eggs and all that.
>>
>> Fair warning: Given the way Sergey tried to talk me out of predicting
>> exactly this kind of problem, and being somewhat down the nose about it as
>> well, I'm having a very, very short fuse about this all.
>>
>> Regards,
>> Jo
>
>
> Most of these issues are general to the way Python handles dependencies and
> packaging and not specific to SymPy or mpmath.  The ImportError is generally
> the best error message you get when a package is missing. The permissions
> issues are due to the way Python gets installed by the system in a place
> that isn't user-writable. You either have to use sudo or know how to install
> somewhere that is user-writable.
>
> Even so, I can guarantee that the following will work (once we do a
> release):
>
> - Installing SymPy via Anaconda or conda will get the mpmath dependency.
> - pip installing SymPy will get mpmath
> - If you have setuptools installed, python setup.py install will download
> and install mpmath, if it isn't installed already.
>
> The toughest situation will be for people who are developing on SymPy (i.e.,
> they just clone the repo, without installing). They will need to know to
> install mpmath, which requires better documentation and error messages.

We should put step by step instructions for developers. I would be
inclined to just put instructions using Conda, i.e. use Conda to
install mpmath, then one can hack on sympy immediately. That way
people can get started, and if they need a different setup, they can
at least start with Conda and then go from there.

Ondrej

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CADDwiVDYPogOAJxzQhHoPNRPYmaJp2vd_goJO5jNauCDB7YM8A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to