Hello all, I am trying to install prefect 2.0 `pip...
# prefect-community
k
Hello all, I am trying to install prefect 2.0
pip install -U "prefect==2.0b1"
and I am encountering below error my machine
Ubuntu 20.04.4 LTS
.
k
I think this is related to installing ray. Are you able to pip install ray? Also you should use 2.0b3, and ray will be removed as a dependency in future releases
upvote 1
a
You can try this on Ubuntu 20.04 LTS:
Copy code
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install software-properties-common -y
sudo apt-get install python3-dateutil -y
sudo apt install python3-pip -y
pip3 install -U "prefect>=2.0b"
this has worked for me on this Ubuntu version we also use Ubuntu in our internal CI for Prefect 2.0, so I'm sure we can resolve that
Moving your code to the thread:
Copy code
Building wheel for gpustat (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/kku/work/poc_ML/envml/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-9ja32lqx/gpustat/setup.py'"'"'; __file__='"'"'/tmp/pip-install-9ja32lqx/gpustat/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-dsmxk9l4
       cwd: /tmp/pip-install-9ja32lqx/gpustat/
  Complete output (7 lines):
  WARNING: The wheel package is not available.
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for gpustat
  Running setup.py clean for gpustat
  Building wheel for nvidia-ml-py3 (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/kku/work/poc_ML/envml/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-9ja32lqx/nvidia-ml-py3/setup.py'"'"'; __file__='"'"'/tmp/pip-install-9ja32lqx/nvidia-ml-py3/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-851neiik
       cwd: /tmp/pip-install-9ja32lqx/nvidia-ml-py3/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for nvidia-ml-py3
  Running setup.py clean for nvidia-ml-py3
Failed to build gpustat nvidia-ml-py3
ERROR: httpcore 0.14.7 has requirement h11<0.13,>=0.11, but you'll have h11 0.13.0 which is incompatible.
k
1. Deleted existing virtual environment. 2. Created a new virtual env. 3. activated the virtual env.
Copy code
4. Ran below commands as suggested (added in a sh script and ran )
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install software-properties-common -y
sudo apt-get install python3-dateutil -y
sudo apt install python3-pip -y
pip3 install -U "prefect>=2.0b"
I don't see the previous errors but I can see below error:
Copy code
ERROR: kubernetes 23.6.0 has requirement pyyaml>=5.4.1, but you'll have pyyaml 5.3.1 which is incompatible.
ERROR: httpcore 0.14.7 has requirement h11<0.13,>=0.11, but you'll have h11 0.13.0 which is incompatible.
Also got some logs that I don't know if that's an issue ..
Copy code
Attempting uninstall: pytz
    Found existing installation: pytz 2019.3
    Not uninstalling pytz at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'pytz'. No files were found to uninstall.
  Attempting uninstall: cryptography
    Found existing installation: cryptography 2.8
    Not uninstalling cryptography at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'cryptography'. No files were found to uninstall.
  Attempting uninstall: click
    Found existing installation: Click 7.0
    Not uninstalling click at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'Click'. No files were found to uninstall.
  Attempting uninstall: protobuf
    Found existing installation: protobuf 3.6.1
    Not uninstalling protobuf at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'protobuf'. No files were found to uninstall.
  Attempting uninstall: MarkupSafe
    Found existing installation: MarkupSafe 1.1.0
    Not uninstalling markupsafe at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'MarkupSafe'. No files were found to uninstall.
a
I see, thanks. Can you try this tutorial? It's for Cloud 2.0 and Ubuntu 20.04 LTS and it worked well for me
k
I could only follow below steps from the tutorial as I don't have EC2 instance
Copy code
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install software-properties-common -y
sudo apt-get install python3-dateutil -y
sudo apt install python3-pip -y
sudo apt install <http://docker.io|docker.io> -y
PATH="$HOME/.local/bin:$PATH"
export PATH
pip3 install -U "prefect>=2.0b" supervisor
Sharing part of the log. Also, I deleted the previous virtual env . and started fresh ...
Copy code
The following packages have unmet dependencies:
 <http://docker.io|docker.io> : Depends: containerd (>= 1.2.6-0ubuntu1~)
E: Unable to correct problems, you have held broken packages.
Collecting prefect>=2.0b
  Using cached prefect-2.0b3-py3-none-any.whl (1.4 MB)
continued ....
Requirement already satisfied, skipping upgrade: googleapis-common-protos<2.0dev,>=1.52.0 in /usr/local/lib/python3.8/dist-packages (from google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0dev,>=1.31.5->google-cloud-storage>=2.1.0->prefect>=2.0b) (1.56.0)
Requirement already satisfied, skipping upgrade: wcwidth>=0.1.4 in /usr/local/lib/python3.8/dist-packages (from blessed>=1.17.1->gpustat>=1.0.0b1; extra == "default"->ray[default]>=1.9; python_version < "3.10" and platform_machine == "x86_64"->prefect>=2.0b) (0.2.5)
Requirement already satisfied, skipping upgrade: pyasn1<0.5.0,>=0.4.6 in /usr/local/lib/python3.8/dist-packages (from pyasn1-modules>=0.2.1->google-auth>=1.0.1->kubernetes>=17.17.0->prefect>=2.0b) (0.4.8)
Installing collected packages: prefect
Successfully installed prefect-2.0b3
Now , the problem is that even though the prefect is installed I am getting
ModuleNotFoundError
Copy code
(env) kku@KKU:~/work/prefect_poc$ prefect --version
2.0b3
(env) kku@KKU:~/work/prefect_poc$ python car_linearregression.py 
Traceback (most recent call last):
  File "car_linearregression.py", line 13, in <module>
    from prefect import flow, task
ModuleNotFoundError: No module named 'prefect'
a
I see, hard to say why this didn't work really... in general, if you need infrastructure support we have a paid support that could help with calls, screenshare etc - just mentioning it in case you may be interested
but for your issue, this might be something off with the Python version or Ray installation definitely worth cross-checking all that and in the worst case trying a fresh new conda installation if nothing else works
k
Python 3.8.10
ray, version 1.12.0
a
Thanks. All I can recommend for now is: • trying a fresh conda env • trying installing Ray etc. separately from Prefect I will communicate with the team whether we can push the change separating out dependencies for Ray and Dask so the installation may get easier soon. Keep us posted on how it goes and I'll keep you posted if I hear anything from the team regarding dependency separation
and regarding the error:
Copy code
ModuleNotFoundError: No module named 'prefect'
it's an issue with the PYTHONPATH - try this