To ensure that your project runs flawlessly on Ubuntu Linux 24.04, you'll need to make some modifications to your requirements.txt file and install necessary system dependencies. Below are the steps and modifications required:
1. Remove Windows-Specific Packages
Certain packages in your requirements.txt are specific to Windows and are not compatible with Ubuntu Linux. Remove the following packages:
pywin32==301: Accesses Windows APIs.
pywinpty==1.1.4: Windows implementation of pseudo-terminals.
wincertstore==0.2: Accesses Windows certificate store.
Updated requirements.txt without Windows-specific packages:
absl-py==0.14.1
argcomplete==1.12.3
argon2-cffi==21.1.0
astor==0.7.1
astunparse==1.6.3
attrs==21.2.0
backcall==0.2.0
bleach==4.1.0
cached-property==1.5.2
cachetools==4.2.4
certifi==2021.5.30
cffi==1.14.6
charset-normalizer==2.0.7
clang==5.0
click==8.0.1
colorama==0.4.4
cycler==0.10.0
debugpy==1.4.3
decorator==5.1.0
defusedxml==0.7.1
entrypoints==0.3
face-recognition==1.3.0
face-recognition-models==0.3.0
flatbuffers==1.12
gast==0.4.0
google-auth==2.3.0
google-auth-oauthlib==0.4.6
google-pasta==0.2.0
grpcio==1.41.0
h5py==3.1.0
idna==3.3
importlib-metadata==4.8.1
ipykernel==6.4.1
ipython==7.28.0
ipython-genutils==0.2.0
ipywidgets==7.6.5
jedi==0.18.0
Jinja2==3.0.1
joblib==1.0.1
jsonschema==3.2.0
jupyter==1.0.0
jupyter-client==7.0.4
jupyter-console==6.4.0
jupyter-core==4.8.1
jupyterlab-pygments==0.1.2
jupyterlab-widgets==1.0.2
keras==2.6.0
Keras-Applications==1.0.7
Keras-Preprocessing==1.1.2
kiwisolver==1.3.2
Markdown==3.1
MarkupSafe==2.0.1
matplotlib==3.4.3
matplotlib-inline==0.1.3
mistune==0.8.4
mock==2.0.0
mtcnn==0.1.1
nbclient==0.5.4
nbconvert==6.2.0
nbformat==5.1.3
nest-asyncio==1.5.1
notebook==6.4.4
numpy==1.19.5
oauthlib==3.1.1
opencv-python==4.5.3.56
opt-einsum==3.3.0
ortools==9.0.9048
packaging==21.0
pandocfilters==1.5.0
parso==0.8.2
pbr==5.1.3
pickleshare==0.7.5
Pillow==8.3.2
prometheus-client==0.11.0
prompt-toolkit==3.0.20
protobuf==3.18.1
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.20
Pygments==2.10.0
pyparsing==2.4.7
pyrsistent==0.18.0
python-dateutil==2.8.2
pyzmq==22.3.0
qtconsole==5.1.1
QtPy==1.11.2
requests==2.26.0
requests-oauthlib==1.3.0
rsa==4.7.2
scikit-learn==0.21.3
scipy==1.7.1
Send2Trash==1.8.0
six==1.15.0
tensorboard==2.7.0
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.0
tensorflow==2.6.0
tensorflow-estimator==2.6.0
termcolor==1.1.0
terminado==0.12.1
testpath==0.5.0
threadpoolctl==2.2.0
tornado==6.1
traitlets==5.1.0
typing-extensions==3.7.4.3
urllib3==1.26.7
wcwidth==0.2.5
webencodings==0.5.1
Werkzeug==0.15.2
widgetsnbextension==3.5.1
wrapt==1.12.1
zipp==3.5.0
2. Install System Dependencies
Some Python packages rely on system libraries that need to be installed separately on Ubuntu.
a. Update and Upgrade the System
sudo apt-get update
sudo apt-get upgrade
b. Install Basic Development Tools
sudo apt-get install build-essential cmake pkg-config
c. Install Libraries for Image and Video Processing
sudo apt-get install libjpeg-dev libtiff-dev libpng-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libxvidcore-dev libx264-dev
sudo apt-get install libgtk-3-dev
sudo apt-get install libatlas-base-dev gfortran
sudo apt-get install libqtgui4 libqtwebkit4 libqt4-test python3-pyqt5
d. Install OpenBLAS and LAPACK
sudo apt-get install libopenblas-dev liblapack-dev
e. Install Boost Libraries (for dlib)
sudo apt-get install libboost-all-dev
f. Install Additional Libraries
sudo apt-get install libhdf5-serial-dev hdf5-tools
sudo apt-get install python3-dev
3. Set Up a Virtual Environment
It's recommended to use a virtual environment to manage your project's dependencies.
sudo apt-get install python3-venv
python3 -m venv venv
source venv/bin/activate
4. Upgrade pip
Ensure you have the latest version of pip within your virtual environment.
pip install --upgrade pip
5. Install the Python Packages
With the virtual environment activated and system dependencies installed, install the packages from your requirements.txt.
pip install -r requirements.txt
6. Special Instructions for TensorFlow
TensorFlow can have hardware compatibility issues. Consider the following:
- CPU Version: If you don't have a compatible GPU, ensure you're installing the CPU version.
- Compatibility: Ensure that the version of TensorFlow is compatible with your version of Python and Ubuntu.
- Alternative Installation: You can install TensorFlow separately if you encounter issues.
pip uninstall tensorflow
pip install tensorflow
7. Verify Installation of Key Packages
a. OpenCV
Test the OpenCV installation:
python -c "import cv2; print(cv2.__version__)"
b. TensorFlow
Test the TensorFlow installation:
python -c "import tensorflow as tf; print(tf.__version__)"
c. Face Recognition
Ensure that face_recognition and its dependencies (dlib) are installed correctly:
python -c "import face_recognition"
8. Update Specific Packages if Necessary
If you encounter compatibility issues, consider updating or downgrading specific packages. For example:
-
Upgrade numpy and scipy
pip install --upgrade numpy scipy
-
Ensure scikit-learn Compatibility
If you face issues with scikit-learn==0.21.3, you can upgrade it:
pip install --upgrade scikit-learn
9. Handling Potential Issues
- Version Conflicts: If you encounter version conflicts, consider unpinning some package versions or finding compatible versions.
- Missing Headers or Libraries: Install any missing development headers or libraries as indicated by error messages during installation.
10. Final Testing
After installing all packages and dependencies, run your project to ensure that everything works as expected on Ubuntu Linux 24.04.
Summary
By removing Windows-specific packages, installing necessary system dependencies, and setting up a proper Python environment, your project should run flawlessly on Ubuntu Linux 24.04. Remember to:
- Keep your virtual environment activated when working on the project.
- Regularly update your packages and system to keep compatibility with newer libraries.
- Consult package documentation for any Ubuntu-specific installation notes.
I hope this helps you get your project up and running on Ubuntu Linux 24.04. If you encounter any issues or need further assistance, feel free to ask!