Closed bjarthur closed 1 month ago
Hi Ben, Thank you for your interest. I am sorry that you encounter these error as the repo was not updated on time. I have just published a new version of our package, for which you can install easily without conda as
pip install DiscoEPG
The only requirements is that you need to have Python installed on your computer (preferably independently from conda)
can't find torch after installing with pip install DiscoEPG
:
% pip install DiscoEPG
Collecting DiscoEPG
Downloading DiscoEPG-0.0.6-py3-none-any.whl.metadata (8.7 kB)
Downloading DiscoEPG-0.0.6-py3-none-any.whl (61 kB)
Installing collected packages: DiscoEPG
Successfully installed DiscoEPG-0.0.6
% python
Python 3.12.6 | packaged by conda-forge | (main, Sep 11 2024, 04:55:15) [Clang 17.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from DiscoEPG import EPGSegment # Importing trainer objects
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/homebrew/Caskroom/miniforge/base/envs/epg/lib/python3.12/site-packages/DiscoEPG/__init__.py", line 1, in <module>
from .models import *
File "/opt/homebrew/Caskroom/miniforge/base/envs/epg/lib/python3.12/site-packages/DiscoEPG/models/__init__.py", line 1, in <module>
from .Segmentation import EPGSegment
File "/opt/homebrew/Caskroom/miniforge/base/envs/epg/lib/python3.12/site-packages/DiscoEPG/models/Segmentation.py", line 1, in <module>
import torch
^^^^^^^^^^^^
ModuleNotFoundError: No module named 'torch'
it seems that you have not installed PyTorch you can do that with this command
pip3 install torch torchvision torchaudio
A small reminder. Since you are working on Mac, it will be difficult to run the Deep Learning algorithms as a key component for PyTorch called CUDA is not supported on Mac.
i get the same error on ubuntu 22.04:
% pip install DiscoEPG
Collecting DiscoEPG
Downloading DiscoEPG-0.0.6-py3-none-any.whl.metadata (8.7 kB)
Downloading DiscoEPG-0.0.6-py3-none-any.whl (61 kB)
Installing collected packages: DiscoEPG
Successfully installed DiscoEPG-0.0.6
(epg)
arthurb-ws3 stern % python
Python 3.12.5 | packaged by Anaconda, Inc. | (main, Sep 12 2024, 18:27:27) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from DiscoEPG import EPGSegment
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/arthurb@hhmi.org/miniconda3/envs/epg/lib/python3.12/site-packages/DiscoEPG/__init__.py", line 1, in <module>
from .models import *
File "/home/arthurb@hhmi.org/miniconda3/envs/epg/lib/python3.12/site-packages/DiscoEPG/models/__init__.py", line 1, in <module>
from .Segmentation import EPGSegment
File "/home/arthurb@hhmi.org/miniconda3/envs/epg/lib/python3.12/site-packages/DiscoEPG/models/Segmentation.py", line 1, in <module>
import torch
^^^^^^^^^^^^
ModuleNotFoundError: No module named 'torch'
moreover, if i manually install torch as you suggested, it now complains it can't find pandas. if i then manually install pandas, it complains about matplotlib. this on both mac and linux.
have you tried installing in a fresh environment (pyenv or conda) on your machine?
Perhaps you can locate into your environment, put this requirements.txt file inside, and run
pip install -r requirements.txt
This will install all the necessary dependencies for DiscoEPG.
i'm not sure how pyenv works, but in a fresh conda env i see none of DiscoEPG's requirements installed in sys.path:
% pip install DiscoEPG
Collecting DiscoEPG
Using cached DiscoEPG-0.0.6-py3-none-any.whl.metadata (8.7 kB)
Using cached DiscoEPG-0.0.6-py3-none-any.whl (61 kB)
Installing collected packages: DiscoEPG
Successfully installed DiscoEPG-0.0.6
% python
Python 3.12.6 | packaged by conda-forge | (main, Sep 11 2024, 04:55:15) [Clang 17.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/opt/homebrew/Caskroom/miniforge/base/envs/epg/lib/python312.zip', '/opt/homebrew/Caskroom/miniforge/base/envs/epg/lib/python3.12', '/opt/homebrew/Caskroom/miniforge/base/envs/epg/lib/python3.12/lib-dynload', '/opt/homebrew/Caskroom/miniforge/base/envs/epg/lib/python3.12/site-packages']
>>>
% ls /opt/homebrew/Caskroom/miniforge/base/envs/epg/lib/python3.12/site-packages
DiscoEPG pip-24.2.dist-info
DiscoEPG-0.0.6.dist-info pkg_resources
README.txt setuptools
_distutils_hack setuptools-73.0.1-py3.12.egg-info
distutils-precedence.pth wheel
pip wheel-0.44.0.dist-info
Can you try this solution?
Perhaps you can locate into your environment, put this requirements.txt file inside, and run
pip install -r requirements.txt
This will install all the necessary dependencies for DiscoEPG.
that almost works. lots of pkgs in my sys.path now. but pywt is missing, and there doesn't seem to be one available for Mac.
i think your fresh pyenv environment must somehow still be accessing your development environment.
% ls /opt/homebrew/Caskroom/miniforge/base/envs/epg/lib/python3.12/site-packages
DiscoEPG nbformat
DiscoEPG-0.0.6.dist-info nbformat-5.10.4.dist-info
IPython nest_asyncio-1.6.0.dist-info
MarkupSafe-2.1.5.dist-info nest_asyncio.py
PIL networkx
README.txt networkx-3.3.dist-info
__pycache__ numba
_cffi_backend.cpython-312-darwin.so numba-0.60.0.dist-info
_distutils_hack numpy
_plotly_future_ numpy-1.26.4.dist-info
_plotly_utils opencv_python-4.10.0.84.dist-info
_soundfile.py orjson
_soundfile_data orjson-3.10.7.dist-info
asttokens packaging
asttokens-2.4.1.dist-info packaging-24.1.dist-info
attr pandas
attrs pandas-2.2.2.dist-info
attrs-24.2.0.dist-info parso
audioread parso-0.8.4.dist-info
audioread-3.0.1.dist-info pexpect
blinker pexpect-4.9.0.dist-info
blinker-1.8.2.dist-info pillow-10.4.0.dist-info
certifi pip
certifi-2024.8.30.dist-info pip-24.2.dist-info
cffi pkg_resources
cffi-1.17.1.dist-info platformdirs
charset_normalizer platformdirs-4.3.2.dist-info
charset_normalizer-3.3.2.dist-info plotly
click plotly-5.22.0.dist-info
click-8.1.7.dist-info plotly_resampler
comm plotly_resampler-0.10.0.dist-info
comm-0.2.2.dist-info pooch
contourpy pooch-1.8.2.dist-info
contourpy-1.3.0.dist-info prompt_toolkit
cv2 prompt_toolkit-3.0.47.dist-info
cycler ptyprocess
cycler-0.12.1.dist-info ptyprocess-0.7.0.dist-info
dash pure_eval
dash-2.18.1.dist-info pure_eval-0.2.3.dist-info
dash_core_components pycparser
dash_core_components-2.0.0.dist-info pycparser-2.22.dist-info
dash_html_components pygments
dash_html_components-2.0.0.dist-info pygments-2.18.0.dist-info
dash_table pylab.py
dash_table-5.0.0.dist-info pyparsing
dateutil pyparsing-3.1.4.dist-info
decorator-5.1.1.dist-info python_dateutil-2.9.0.post0.dist-info
decorator.py pyts
distutils-precedence.pth pyts-0.13.0.dist-info
easydict pytz
easydict-1.13.dist-info pytz-2024.2.dist-info
executing referencing
executing-2.1.0.dist-info referencing-0.35.1.dist-info
fastjsonschema requests
fastjsonschema-2.20.0.dist-info requests-2.32.3.dist-info
filelock retrying-1.3.4.dist-info
filelock-3.16.0.dist-info retrying.py
flask rpds
flask-3.0.3.dist-info rpds_py-0.20.0.dist-info
fontTools scikit_learn-1.5.1.dist-info
fonttools-4.53.1.dist-info scipy
fsspec scipy-1.14.0.dist-info
fsspec-2024.9.0.dist-info seaborn
functorch seaborn-0.13.2.dist-info
idna setuptools
idna-3.8.dist-info setuptools-73.0.1-py3.12.egg-info
importlib_metadata six-1.16.0.dist-info
importlib_metadata-8.5.0.dist-info six.py
ipython-8.27.0.dist-info sklearn
ipywidgets soundfile-0.12.1.dist-info
ipywidgets-8.1.3.dist-info soundfile.py
isympy.py soxr
itsdangerous soxr-0.5.0.post1.dist-info
itsdangerous-2.2.0.dist-info stack_data
jedi stack_data-0.6.3.dist-info
jedi-0.19.1.dist-info sympy
jinja2 sympy-1.13.2.dist-info
jinja2-3.1.4.dist-info tenacity
joblib tenacity-9.0.0.dist-info
joblib-1.4.2.dist-info threadpoolctl-3.5.0.dist-info
jsonschema threadpoolctl.py
jsonschema-4.23.0.dist-info torch
jsonschema_specifications torch-2.3.1.dist-info
jsonschema_specifications-2023.12.1.dist-info torchgen
jupyter.py tqdm
jupyter_core tqdm-4.66.5.dist-info
jupyter_core-5.7.2.dist-info traitlets
jupyterlab_plotly traitlets-5.14.3.dist-info
jupyterlab_widgets tsdownsample
jupyterlab_widgets-3.0.13.dist-info tsdownsample-0.1.3.dist-info
kiwisolver typing_extensions-4.12.2.dist-info
kiwisolver-1.4.7.dist-info typing_extensions.py
lazy_loader tzdata
lazy_loader-0.4.dist-info tzdata-2024.1.dist-info
librosa urllib3
librosa-0.10.2.post1.dist-info urllib3-2.2.3.dist-info
llvmlite wcwidth
llvmlite-0.43.0.dist-info wcwidth-0.2.13.dist-info
markupsafe werkzeug
matplotlib werkzeug-3.0.4.dist-info
matplotlib-3.9.1.dist-info wheel
matplotlib_inline wheel-0.44.0.dist-info
matplotlib_inline-0.1.7.dist-info widgetsnbextension
mpl_toolkits widgetsnbextension-4.0.13.dist-info
mpmath xgboost
mpmath-1.3.0.dist-info xgboost-2.1.0.dist-info
msgpack zipp
msgpack-1.1.0.dist-info zipp-3.20.1.dist-info
% python
Python 3.12.6 | packaged by conda-forge | (main, Sep 11 2024, 04:55:15) [Clang 17.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from DiscoEPG import EPGDataset
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/homebrew/Caskroom/miniforge/base/envs/epg/lib/python3.12/site-packages/DiscoEPG/__init__.py", line 1, in <module>
from .models import *
File "/opt/homebrew/Caskroom/miniforge/base/envs/epg/lib/python3.12/site-packages/DiscoEPG/models/__init__.py", line 1, in <module>
from .Segmentation import EPGSegment
File "/opt/homebrew/Caskroom/miniforge/base/envs/epg/lib/python3.12/site-packages/DiscoEPG/models/Segmentation.py", line 14, in <module>
from .Dataset import EPGDataset
File "/opt/homebrew/Caskroom/miniforge/base/envs/epg/lib/python3.12/site-packages/DiscoEPG/models/Dataset.py", line 13, in <module>
from ..dataset_utils.datagenerator import generate_sliding_windows_single
File "/opt/homebrew/Caskroom/miniforge/base/envs/epg/lib/python3.12/site-packages/DiscoEPG/dataset_utils/datagenerator.py", line 5, in <module>
import pywt
^^^^^^^^^^^
ModuleNotFoundError: No module named 'pywt'
% pip install pywt
ERROR: Could not find a version that satisfies the requirement pywt (from versions: none)
ERROR: No matching distribution found for pywt
Sorry, it miswrote that package. pip install PyWavelets
should work!
that works! thanks so much. you should probably either update the docs with the requirement.txt step, or somehow get those deps into the wheel.
i'm not going to re-open this issue b/c the docs on installation to use the requirements.txt file work, but i will say that having to do so is an unusual way to install a python package. matplotlib's docs, for example, simply say to pip install. no mention of a requirements.txt file at all. i know nothing about creating packages in python (it's so much easier in Julia), but somehow there must be a way to get your dependencies into the wheel, and doing so would make it a lot easier for users of this package.
also, your docs for a conda install need an extra step to install python itself. conda is a package manager meant to support all programming languages, and so it doesn't install any by default.
Hi Ben,
Thank you very much for your suggestion. I think your opinions are reasonable. I will make sure the issues are taken care of.
Best,
On Mon, Sep 16, 2024 at 3:18 PM Ben Arthur @.***> wrote:
i'm not going to re-open this issue b/c the docs on installation to use the requirements.txt file work, but i will say that having to do so is an unusual way to install a python package. matplotlib's docs https://matplotlib.org/stable/install/index.html, for example, simply say to pip install. i know nothing about creating packages in python (it's so much easier in Julia), but somehow there must be a way to get your dependencies into the wheel, and doing so would make it a lot easier for users of this package.
also, your docs for a conda install need an extra step to install python itself. conda is a package manager meant to support all programming languages, and so it doesn't install any by default.
— Reply to this email directly, view it on GitHub https://github.com/HySonLab/ML4Insects/issues/1#issuecomment-2352897147, or unsubscribe https://github.com/notifications/unsubscribe-auth/BDAVC4JKX4RYW3PIKDTRU2TZW3LCBAVCNFSM6AAAAABOEAOXGGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJSHA4TOMJUG4 . You are receiving this because you commented.Message ID: @.***>
-- DINH Quang-Dung M.Sc. student Institut Galilée Université Sorbonne Paris Nord *99 Av. Jean Baptiste Clément, 93430 Villetaneuse, *Paris, France
trying to install on a Mac and am having problems because i'm not terribly familiar with python (usually use Julia). i start out by installing miniforge, python, and then cloning your repo, all of which works:
but then how do i install your python package?
python setup.py install
gives me a warning about this not being the right way to do it. so i google and it says to dopip install .
instead. so i do that, but then your code can't find "easydict":so i try:
now it complains it can't find "cv2":
so i
pip install opencv-python
and now get "ImportError: attempted relative import beyond top-level package":any help would be appreciated. thanks!