Hello , when I restarted my laptop, I tried to run...
# prefect-ui
r
Hello , when I restarted my laptop, I tried to run Prefect on local, so I typed the command perefct server start, but an error showed me "prefect: command not found" do you have an idea?
k
Were you in a virtual environment when you installed it?
r
No on Ubuntu WSL, I ran the "npm run serve" command and logged in on UI but not logged in to server
a
Does this output `pip show prefect`anything?
r
no I only have prefect: command not found
k
Yeah hard to tell what happened but seems like you don’t have Prefect installed anymore
r
Prefect is installed, because if it is not installed I will not connect to the UI on localhost:8080 with the npm run serve command, and when I do pip install prefect it gives me that it already exists
k
pip install prefect
says it exists but
pip show prefect
shows nothing?? I would expect it to show something
r
Name: prefect Version: 1.2.0 Summary: The Prefect Core automation and scheduling engine. Home-page: https://www.github.com/PrefectHQ/prefect Author: Prefect Technologies, Inc. Author-email: help@prefect.io with the pip show prefect commandLicense: Apache License 2.0 Location: /home/zineb/.local/lib/python3.8/site-packages Requires: marshmallow-oneofschema, cloudpickle, docker, python-slugify, packaging, distributed, croniter, pytz, msgpack, pyyaml, mypy-extensions, requests, marshmallow, python-dateutil, click, python-box, urllib3, dask, pendulum, tabulate, importlib-resources, toml Required-by:
k
Ah ok do you have 2 python versions on the machine?
r
I have python 3.9 which is installed on windows, and python 3.8 which on Ubuntu in WSL
k
Can you try doing
which python
and
which pip
?
r
this is what gives me
k
wait what? what happens if you just type
python
, like to start an interactive shell
for reference, this is what it looks like for me (running in docker right now)
Copy code
root@60b2448d651a:/opt/prefect# which python
/usr/local/bin/python
root@60b2448d651a:/opt/prefect# which pip
/usr/local/bin/pip
so for you it seems it can’t find a python installation
r
for me, because I've python 3: zineb@EQ-EQ6288793:~$ which python3 /usr/bin/python3 zineb@EQ-EQ6288793:~$ which pip3 /usr/bin/pip3
and when I type python3 it gives me python editor to write codes
k
So does
pip3 show prefect
show an installation too?
r
Name: prefect Version: 1.2.0 Summary: The Prefect Core automation and scheduling engine. Home-page: https://www.github.com/PrefectHQ/prefect Author: Prefect Technologies, Inc. Author-email: help@prefect.io License: Apache License 2.0 Location: /home/zineb/.local/lib/python3.8/site-packages Requires: croniter, dask, importlib-resources, docker, pytz, python-slugify, tabulate, python-box, pendulum, urllib3, mypy-extensions, click, distributed, cloudpickle, marshmallow-oneofschema, toml, packaging, marshmallow, python-dateutil, pyyaml, msgpack, requests Required-by:
k
Ok we need to point your python3 to be the default python. I don’t know how to do this immediately. Will look a bit
r
Steps to Set Python3 as Default On ubuntu? • Check python version on terminal -
python --version
• Get root user privileges. On terminal type -
sudo su
• Write down the root user password. • Execute this command to switch to python 3.6.
update-alternatives --install /usr/bin/python python /usr/bin/python3 1
• Check python version -
python --version
• All Done!
k
Did that work for you?
👍 1
You issue is similar to this . Maybe you can export the PATH and pip install with the --user flag. These issues are always hard to deal with
r
I don't think so, because the UI works well if the problem is at the python level, I'm going to make codes or runner scripts!
I'll look into that, and I'll keep looking for solutions
k
Yes this is a path issue, and is why using something like Anaconda makes things easier
r
Hello, during my work on Ubuntu and prefect I typed a command to start local agent and this error message appeared to me another time!! is this problem related to the configuration of prefect? because I did an installation with pip and then I connected the UI with server
k
This is a python environment issue and potentially having multiple interpreters. If you only have one Python installation or if you use something like Anaconda it should be fine
r
I have just python3, Python 3.8.10
k
This really isn’t a Prefect issue if the environment is consistent. There really isn’t anything configurable about Python packages that would affect this. I think you can test with another library (like with pandas) and I think you should see the same behavior
r
I did pip install pandas and it works fine "Successfully installed numpy-1.22.3 pandas-1.4.2"
k
Ah ok it’s really the CLI though that is not using the correct Python path. This is honestly pretty hard to mange without something like Anaconda. Can you use
conda
as an environment manager?
a
@RAISS Zineb I'm gonna write a Discourse topic on how you can troubleshoot and fix this error, will send a link in a moment
👍 1
r
Yes @Anna Geller It's working with python3 -m prefect server start
Thank you @Kevin Kho and @Anna Geller
👍 1