Python help & hand-holding?

33 views
Skip to first unread message

Colin Rowat

unread,
Mar 14, 2020, 9:12:40 PM3/14/20
to tokyohac...@googlegroups.com
Hi again,

Would anyone have time to help me with some basic Python questions? I'm trying to build and install packages with conda rather than pip.

(Background: marking student assignments; their notebooks specify pip install commands, which are breaking my package installations.)

Coffee/drinks/meals on me in return!

Thank you / ありがとう

Colin Rowat
London Hackspace / https://icibici.github.io/site/

Curt J. Sampson

unread,
Mar 15, 2020, 11:09:46 PM3/15/20
to tokyohac...@googlegroups.com
On 2020-03-15 01:12 -0000 (Sun), Colin Rowat wrote:

> Would anyone have time to help me with some basic Python questions?
> I'm trying to build and install packages with conda rather than pip.
> (Background: marking student assignments; their notebooks specify
> pip install commands, which are breaking my package installations.)

You're talking about meeting up in person in Tokyo? Anyway, I do, and
plenty of experience with Python over the last couple of years. (Not
much with Conda, but shouldn't be hard to figure out.)

The best way to get in touch with me is via @cjs_cynic on Telegram,
but Google Hangouts or email to <c...@cynic.net> will work, too.

cjs
--
Curt J. Sampson <c...@cynic.net> +81 90 7737 2974

To iterate is human, to recurse divine.
- L Peter Deutsch

David Lyon

unread,
Mar 15, 2020, 11:37:32 PM3/15/20
to tokyohac...@googlegroups.com
Hi,

I have done decades of Python programming so here is a 'Professional opinion' which you can read and make your own decision on. 

I really suggest to stay with PIP :-) There is too much package dependency in the Python system to make it worth deviating from PIP. Things will go wrong, quickly, and you'll end up in a rabbit hole.

Lot's of folk use virtualenv https://docs.python-guide.org/dev/virtualenvs/ to get around packaging issues.

For most python packages, you should be able to install them locally or in a virtual environment.

Is it specific packages that can't be installed? if so, which?


Which should do what you want.




--
このメールは Google グループのグループ「TokyoHackerSpace」の登録者に送られています。
このグループから退会し、グループからのメールの配信を停止するには tokyohackerspa...@googlegroups.com にメールを送信してください。
このディスカッションをウェブ上で閲覧するには、https://groups.google.com/d/msgid/tokyohackerspace/008f01d5fa66%24d28753b0%247795fb10%24%40espero.org.uk にアクセスしてください。

Curt J. Sampson

unread,
Mar 16, 2020, 12:04:51 AM3/16/20
to tokyohac...@googlegroups.com
There are plenty of situations where the details differ, sometimes
dramatically, of course, but in general David's advice is the best way
to go about things:

On 2020-03-16 14:37 +1100 (Mon), David Lyon wrote:

> I really suggest to stay with PIP :-) There is too much package dependency
> in the Python system to make it worth deviating from PIP. Things will go
> wrong, quickly, and you'll end up in a rabbit hole.

My general strategy divides the environment into three layers:

1. The Python interpreter itself, and packages installed with it. This
is generally:
a. a version of Python installed with pythonz[1] and _no_
packages (just the standard library that comes with Python);
b. a system Python that comes with your Linux distribution plus
only whatever additional packages are needed for programs
installed by your Linux package manager (which you generally
ignore); or
c. a standard install of Python on Windows and the `py` launcher[2]
to invoke it.
2. A --user install of pip, virtualenv and virtualenvmanager, anad
their dependencies, and nothing else. (Note that I try to keep pip
out of the interpreter installs above.
3. Virtualenvs for everything else, as part of the project when I'm
working on a project (see cpd[3] for an example) or with
virtualenvmanager for everything else (e.g., when I want to use
the AWS command-line tool).

There will no doubt be situations where you can't or find it terribly
inconvenient to do this, but if you can do this then I've found it to
cause the fewest problems with interactions between separate projects
and programs.

[1]: https://github.com/saghul/pythonz
[2]: https://docs.python.org/3/using/windows.html#launcher
[3]: https://github.com/dot-home/cpd

Net Imp

unread,
Mar 16, 2020, 3:33:09 AM3/16/20
to tokyohac...@googlegroups.com
I concur, virtualenv with pip is the way to go.

--
このメールは Google グループのグループ「TokyoHackerSpace」の登録者に送られています。
このグループから退会し、グループからのメールの配信を停止するには tokyohackerspa...@googlegroups.com にメールを送信してください。
このディスカッションをウェブ上で閲覧するには、https://groups.google.com/d/msgid/tokyohackerspace/20200316040448.ugzi7hn4d7egfcui%40logarithmic.cjs.cynic.net にアクセスしてください。

Colin Rowat

unread,
Mar 16, 2020, 10:38:36 PM3/16/20
to TokyoHackerSpace
Thanks all.  Ironically, I've read these messages while my Anaconda Prompt is "examining conflict" (as it has been for the past half hour or so).

Curt - I'll take you up on your kind offer, and message you now: thank you!

Colin
Reply all
Reply to author
Forward
0 new messages