- 1 year ago
fcntl error with “mlflow ui” on windows - mlflow 1.0
The fcntl
error you're experiencing with mlflow ui
on Windows is likely due to the fact that fcntl
is a Unix-specific module that is not available in Windows.
The fcntl
module is used for file control, and its usage in mlflow ui
may be specific to Unix systems.
To run mlflow ui
on Windows, you can try the following workaround:
Install the
psutil
package in your Python environment if you don't have it already. You can install it usingpip
:shellpip install psutil
Modify the
mlflow/ui/server.py
file in yourmlflow
installation directory. Locate the following lines:pythonimport fcntl
# ...
def get_server_url(port):
# ...
# Wait for the server to bind before exiting
fcntl.flock(sock.fileno(), fcntl.LOCK_EX)
Replace the
fcntl
module import andfcntl.flock
function call with thepsutil
module:pythonimport psutil
# ...
def get_server_url(port):
# ...
# Wait for the server to bind before exiting
psutil.Process().wait_fds([sock.fileno()])
Save the changes to
server.py
and try runningmlflow ui
again.
This modification replaces the fcntl
module with psutil
, which provides similar functionality for waiting on file descriptors to be ready.
Note that modifying the source code of an installed package is not recommended in general, as it may cause issues during updates or future installations. Therefore, it's advisable to keep track of your changes and reapply them if you update the mlflow
package in the future.