-
Notifications
You must be signed in to change notification settings - Fork 3
Description
I created a 3.8 virtualenv (at ~/.virtualenvs/PROJECT
) for for dojopy, and then ran dojopy.install() there. It asked for root, and proceeded to make another virtualenv under mine, at ~/.virtualenvs/PROJECT/lib/python3.8/site-packages/auto_generated_dojo_env/bin/activate
.
The install()
process finished, but there was an error in the output above that ending with
File "/tmp/pip-install-zq3kyj_q/pillow/setup.py", line 804, in build_extensions
raise RequiredDependencyException(f)
__main__.RequiredDependencyException: jpeg
I though maybe I could fix this by activating that inner virtualenv directly after dectivating mine, and then installing Pillow>=8.0.0 directly. However, the python3
in that bin folder is a symlink to the nonexistent /root/.pyenv/versions/3.8.2/bin/python3
, so that environment was broken if I tried to activate it in a fresh terminal (which python
points to /usr/bin/python
, and ipython fails with a Permission denied.
I created the above PROJECT venv directly with python3 -m venv ...
. Julia 1.7.2 is installed already in /usr/local/bin/julia, I believe with apt.
Looking a little deeper, decided that it would make more sense to ru n install_dojopy.bash
as my user, but then put some sudo
s on the apt commands used. So I moved the dojopy clone to a new ~/Dropbox/Projects/Dojo
WORKING_DIR
, and did this diff (see fork):
diff --git a/dojopy/__init__.py b/dojopy/__init__.py
index 43dc227..957dfcc 100644
--- a/dojopy/__init__.py
+++ b/dojopy/__init__.py
@@ -15,7 +15,7 @@ def install(ENV_DIR="", *, confirm=False):
WORKING_DIR = dirname(dirname(abspath(__file__)))
FILE_DIR = dirname(abspath(__file__))
p = subprocess.Popen(
- ["sudo", "bash", join(FILE_DIR, "install_dojopy.bash"), WORKING_DIR, ENV_DIR],
+ ["bash", join(FILE_DIR, "install_dojopy.bash"), WORKING_DIR, ENV_DIR],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
text=True)
diff --git a/dojopy/install_dojopy.bash b/dojopy/install_dojopy.bash
index 1a04391..ac2126c 100644
--- a/dojopy/install_dojopy.bash
+++ b/dojopy/install_dojopy.bash
@@ -1,6 +1,6 @@
echo "█████ STEP 0/7 -define arguments"
# directory where we cloned the dojopy package
-WORKING_DIR=${1:-$HOME/Documents/dojopip}
+WORKING_DIR="/home/tsbertalan/Dropbox/Projects/Dojo/"
# directory where python environment will be installed
ENV_DIR=${2:-$WORKING_DIR/auto_generated_dojo_env}
# directory of the cloned dojopy package
@@ -24,11 +24,11 @@ echo "PY_PATH" $PY_PATH
echo "█████ STEP 1/7 - pyenv installation"
echo "█████ stage 1 - update and install dependencies"
-apt update -y
+sudo apt update -y
echo "█████ stage 2 - install all of pyenv’s dependencies"
-apt install -y make build-essential libssl-dev zlib1g-dev \
+sudo apt install -y make build-essential libssl-dev zlib1g-dev libjpeg-dev \
> libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev\
> libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl\
> git
I then pip-uninstalled dojopy and reran pip install -e ./dojopy
in my env. After this, bash dojopy/dojopy/install_dojopy.bash
seemed to work, but if I deactivate
, source auto_generated_dojo_env/bin/activate
, and run the sample pendulum 1-step script, I get
Traceback (most recent call last):
File "test_dojopy.py", line 2, in <module>
from julia import Base
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
File "/home/tsbertalan/Dropbox/Projects/Dojo/auto_generated_dojo_env/lib/python3.8/site-packages/julia/core.py", line 248, in load_module
elif self.julia.isafunction(juliapath):
File "/home/tsbertalan/Dropbox/Projects/Dojo/auto_generated_dojo_env/lib/python3.8/site-packages/julia/core.py", line 239, in julia
self.__class__.julia = julia = Julia()
File "/home/tsbertalan/Dropbox/Projects/Dojo/auto_generated_dojo_env/lib/python3.8/site-packages/julia/core.py", line 483, in __init__
raise UnsupportedPythonError(jlinfo)
julia.core.UnsupportedPythonError: It seems your Julia and PyJulia setup are not supported.
Julia executable:
julia
Python interpreter and libpython used by PyCall.jl:
None
None
Python interpreter used to import PyJulia and its libpython.
/home/tsbertalan/Dropbox/Projects/Dojo/auto_generated_dojo_env/bin/python
/home/tsbertalan/.pyenv/versions/3.8.2/lib/libpython3.8.so.1.0
In Julia >= 0.7, above two paths to `libpython` have to match exactly
in order for PyJulia to work out-of-the-box. To configure PyCall.jl to use
Python interpreter "/home/tsbertalan/Dropbox/Projects/Dojo/auto_generated_dojo_env/bin/python",
run the following code in the Python REPL:
>>> import julia
>>> julia.install()
For more information, see:
https://pyjulia.readthedocs.io/en/latest/troubleshooting.html
But there is a bird in the office now, so I'll need to go home and continue this troubleshooting tomorrow.