Houdini Python 3 - observations

   3539   4   1
User Avatar
Member
301 posts
Joined: July 2005
Offline
Testing out Houdini 18.0.385 on Windows 10

hython
Python 3.7.4 (default, Feb 13 2020, 14:42:08) [MSC v.1916 64 bit (AMD64)] on win32
Houdini 18.0.385 hou module imported.
Type "help", "copyright", "credits" or "license" for more information.

So far, all good

hython -m pip --version
C:\PROGRA~1\SIDEEF~1\HOUDIN~1.385\bin\hython.exe: No module named pip

I thought pip has been shipping with Python since 2.7.9

hython -m venv
usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear]
            [--upgrade] [--without-pip] [--prompt PROMPT]
            ENV_DIR [ENV_DIR ...]
venv: error: the following arguments are required: ENV_DIR

This is great, virtual environment is shipping with hython :-)

hython -m venv h_venv
Error: [WinError 2] The system cannot find the file specified

Hmmm, something is not right with venv as shipped with hython.

Cheers
Nicholas Yue
User Avatar
Staff
3456 posts
Joined: July 2005
Offline
you'll need to get pip, try this:
https://pip.pypa.io/en/stable/installing/ [pip.pypa.io]

and just replace: python get-pip.py
with this: hython get-pip.py

you may need to do this as an Admin
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
900 posts
Joined: Feb. 2016
Offline
goldfarb
you'll need to get pip, try this:
https://pip.pypa.io/en/stable/installing/ [pip.pypa.io]

and just replace: python get-pip.py
with this: hython get-pip.py

you may need to do this as an Admin
Hello,
why PIP doesn't come installed with Houdini already?
I've been wasting so much time trying to have it installed for the Houdini Python Environment...

I'm using the hython get-pip.py command and receive the "successful installation" message, but the issue is that PIP is getting installed in a "VENV" directory of a deleted virtual environment.
Even when I delete the directory again, get-pip.py would re-build it again and put the pip files in it.
Indeed hython cannot find any pip module installed.
User Avatar
Member
256 posts
Joined: July 2013
Offline
"ensurepip" makes everything much easier.


hython.exe -m ensurepip --upgrade

Then use:

hython.exe -m pip install SomePackage

ensurepip is a new Pyhthon function that was added in py3: https://docs.python.org/3/library/ensurepip.html [docs.python.org]
More code, less clicks.
User Avatar
Member
900 posts
Joined: Feb. 2016
Offline
thanks for the tip!

It turned out that I had modified the pip.ini file with
[global]
target= /path/to/Venv
That's why PIP was getting installed always in that directory.
  • Quick Links