Skip to content
Mohammed EL-KHOU edited this page Oct 6, 2022 · 1 revision

Welcome to the m-elkhou wiki!

pip freeze > requirements.txt # will save all your python libraries with current version into requirements.txt file

python -m pip install -U pip setuptools wheel python -m pip install -U cmake Cython numpy pandas pip install -U opencv-python opencv-contrib-python matplotlib plotly python -m pip install -U jupyter jupyterlab notebook

sudo apt-get install jupyter-notebook

Change your Notebook theme :

# install jupyterthemes
pip install -U jupyterthemes

# Now you can install the super popular dark theme with
jt -t chesterish
# from https://medium.com/@rbmsingh/making-jupyter-dark-mode-great-5adaedd814db
jt -t monokai -f fira -fs 13 -nf ptsans -nfs 11 -N -kl -cursw 5 -cursc r -cellw 95% -T
jt -t monokai -f fira -fs 9 -nf ptsans -ofs 7 -nfs 8 -tfs 10 -dfs 8 -N -kl -cursw 5 -cursc r -cellw 90% -T
jt -t grade3 -f fira -fs 9 -nf ptsans -ofs 7 -nfs 8 -tfs 10 -dfs 8 -N -kl -cursw 5 -cursc r -cellw 90% -T
# Restore the main theme any time with
jt -r
# list available themes
# onedork | grade3 | oceans16 | chesterish | monokai | solarizedl | solarizedd

pip install -U jupyter_contrib_nbextensions
jupyter contrib nbextension install --user



pip install pipwin
pipwin install pyaudio


conda install -c anaconda python=3.8
conda update --all


conda install jupyter                # install jupyter + notebook
jupyter notebook                     # start server + kernel inside my-conda-env



jupyter kernelspec list
where pip

python -m pip --version
python -m pip install ipyker

nel
python -m ipykernel install --user

conda create -n ipykernel_py python=3 ipykernel
activate ipykernel_py   
python -m ipykernel install --user

conda installed pywin32
pip install pypiwin32

conda config --append channels conda-forge
conda install -c conda-forge win32api





To compress
tar -zcvf archive_name.tar.gz folder_to_compress
To extract
tar -zxvf archive_name.tar.gz
tar -zxvf musan.tar.gz -C "/files/data_asr/musan"

wget -O model.tar --no-check-certificate https://drive.google.com/uc?id=ggggggggggggggggggg
gdown https://drive.google.com/uc?id=gggggggggggggggggggg



py to exe:
---------
# in cmd
python -m venv env
env\Scripts\activate.bat
pip install -U -r requirements.txt
pip install git+https://github.com/facebookresearch/fvcore
pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
pip install git+https://github.com/conansherry/detectron2
pip install auto-py-to-exe
auto-py-to-exe


pip install pyinstaller[encryption]

#pytorch OSError: could not get source code:
--------------------------------------------
pip install https://github.com/pyinstaller/pyinstaller/archive/refs/heads/develop.zip

# You need to modifiy the pyinstaller FrozenImporter in "PyInstaller/loader/pyimod03_importers.py" class as well:
class FrozenImporter(object):
    def get_source(self, fullname):
        """
        Method should return the source code for the module as a string.
        But frozen modules does not contain source code.

        Return None.
        """
        if fullname in self.toc:
            sourcename = f"src.{fullname}"
            if sourcename in self.toc:
                return self._pyz_archive.extract(sourcename)[1].decode("utf-8")
            return None
        else:
            # ImportError should be raised if module not found.
            raise ImportError('No module named ' + fullname)


pip install -U pyinstaller==4.5.1

pyinstaller --onedir "C:/d/3wm/uw/app.spec" --clean --distpath distAPP

pyinstaller --noconfirm --onefile app.spec --clean --console --icon "C:/Users/melkh/Downloads/robot02_90810.ico" --add-data "C:/d/3wm/uw/data;." --add-data "C:/d/3wm/uw/src;." --add-data "C:/d/3wm/uw/config.yaml;." "C:/d/3wm/uw/run.py"

pyinstaller --noconfirm --onefile C:/d/3wm/uw/app.spec" --console --clean --icon "C:/Users/melkh/Downloads/robot02_90810.ico"


pyinstaller --noconfirm --onefile --console C:/d/3wm/uw/detectron2.spec --clean --icon C:/Users/melkh/Downloads/robot02_90810.ico --distpath C:\Users\melkh\AppData\Local\Temp\tmprfdi9zo1\application --workpath C:\Users\melkh\AppData\Local\Temp\tmprfdi9zo1\build --specpath C:\Users\melkh\AppData\Local\Temp\tmprfdi9zo1

pyinstaller --noconfirm --onefile --console C:/d/3wm/uw/run.py --distpath C:\Users\melkh\AppData\Local\Temp\tmprfdi9zo1\application --workpath C:\Users\melkh\AppData\Local\Temp\tmprfdi9zo1\build --specpath C:\Users\melkh\AppData\Local\Temp\tmprfdi9zo1



pyinstaller --onefile -w tt.py --add-data "tt;tt/"


pyinstaller --onedir run.spec --console --noconfirm --clean



pip install -U torch==1.7.1+cpu torchvision==0.8.2+cpu -f https://download.pytorch.org/whl/torch_stable.html
git clone https://github.com/ivanpp/detectron2.git
cd detectron2
pip install -e .

[
        "C:/d/3wm/uw/env/Lib/site-packages/torch/lib/torch_python.dll",
        "C:/d/3wm/uw/env/Lib/site-packages/torch/lib/torch_cpu.dll",
        "C:/d/3wm/uw/env/Lib/site-packages/torch/lib/c10.dll",
        "C:/d/3wm/uw/env/Lib/site-packages/torch/lib/libiomp5md.dll"],
Clone this wiki locally