DynamicsAndNeuralSystems / pyspi

Comparative analysis of pairwise interactions in multivariate time series.
https://time-series-features.gitbook.io/pyspi/
GNU General Public License v3.0
199 stars 26 forks source link

Cannot install PySPI on Win10 #15

Closed atlaie closed 6 months ago

atlaie commented 2 years ago

Hi Oliver,

I'm currently trying to install the PySPI package (following the instructions that I found on the documentation) on a Windows 10 system and an error pops up:

_error: Multiple top-level packages discovered in a flat-layout: ['sktime', 'build_tools', 'extension_templates'].

  To avoid accidental inclusion of unwanted files or directories,
  setuptools will not proceed with this build.

  If you are trying to create a single distribution with multiple packages
  on purpose, you should not rely on automatic discovery.
  Instead, consider the following options:

  1. set up custom discovery (`find` directive with `include` or `exclude`)
  2. use a `src-layout`
  3. explicitly set `py_modules` or `packages` with a list of names

  To find more information, look for "package discovery" on setuptools docs.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details._

AFAIK, this is related to setuptools, but I don't know how to fix it, any ideas?

olivercliff commented 2 years ago

Hi there,

Thanks for reporting this. Unfortunately, I can't test on a windows machine, but I wonder if you could try out the suggested fix to disable the auto-discovery.

Could you try putting py_modules=[] into the setup.py, perhaps after line 45, and re-installing?

atlaie commented 2 years ago

Thanks for the guidance! Sadly, it didn't work.

Anyway, I managed to install PySPI on a Linux machine, so it's fine from my side :)

olivercliff commented 2 years ago

Shame about the fix not working, but great to hear you've got pyspi up and running.

If I get access to a windows machine soon I'll see what I can do.

rmzargar commented 1 year ago

I encountered a few issues while installing and running pyspi on Windows 11. Initially, I realized that I needed to use Python 3.8 specifically for this package. The later versions caused problems during the installation of libraries like sktime 0.8.0.

Next, I encountered problems with the system's octave and Java path. To resolve this, I added the following code before running the calculations:

import os pathToExecutable = "C:/Program Files/GNU Octave/Octave-8.2.0/mingw64/bin/octave-cli.exe" pathToJAVA_HOME = "C:/Program Files/Java/jdk-20" os.environ['OCTAVE_EXECUTABLE'] = pathToExecutable os.environ['JAVA_HOME'] = pathToJAVA_HOME

Later on, I encountered another error indicating the following: "ImportError: cannot import name 'Int64Index' from 'pandas'" I managed to resolve this by removing the newer versions of Pandas and numpy and installing Pandas 1.3.3 and numpy 1.21.1 instead. Although pyspi installs the latest versions of these packages, it seems that we need to install the specific versions mentioned in the setup file of the pyspi package.

I hope this information proves useful for those interested in installing pyspi on Windows.

benfulcher commented 1 year ago

Thanks @rmzargar It seems like @anniegbryant has incorporated some of this into the documentation in #27 to help future Windows users. Really appreciate you taking the time to share :) feel free to let us know if the docs could be clearer.

HamidSediqi commented 11 months ago

Hey Oliver,

I'm having issues with installing pyspi. Things seem to be fine when I run these two lines in my conda environment cmd prompt

$ git clone https://github.com/olivercliff/pyspi.git $ cd pyspi

But when I run "pip install .", I get the following error:

"× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [41 lines of output]"

I have limited experience with coding so I might be doing something silly, so would appreciate any guidance you can provide.

FYI: Computer is Windows 10, I've already installed Octave and Java. I've also updated 'ez_setup.py', and pip to version is 23.2.1.

olivercliff commented 11 months ago

Hi there,

I haven't seen that error before but it seems like a common issue when using conda. Have you updated setuptools as well as pip?

It seems there also might be more output after the exit code (41 lines of output), could you paste those here if updating setuptools does not work.

HamidSediqi commented 11 months ago

Hey Oliver,

Thanks for your email and help with this.

So, I’ve done all the things mentioned in the document you linked: updated setup tool, pip and anaconda, as well as install ‘wheel’. I’m still getting the same error.

Preparing metadata (setup.py) ... error

error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.

│ exit code: 1

╰─> [41 lines of output]

  C:\Users\hsediq01\AppData\Local\Temp\pip-install-81ryxd8a\sktime_69031f44d83d413da37224ac9b3ec088\setup.py:20: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html

    from pkg_resources import parse_version

  C:\Users\hsediq01\AppData\Local\anaconda3\envs\pyspi\lib\site-packages\setuptools\dist.py:498: SetuptoolsDeprecationWarning: Invalid dash-separated options

  !!

          ********************************************************************************

          Usage of dash-separated 'description-file' will not be supported in future

          versions. Please use the underscore name 'description_file' instead.

          This deprecation is overdue, please update your project and remove deprecated

          calls to avoid build errors in the future.

          See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.

          ********************************************************************************

  !!

    opt = self.warn_dash_deprecation(opt, section)

  C:\Users\hsediq01\AppData\Local\anaconda3\envs\pyspi\lib\site-packages\setuptools\__init__.py:80: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.

  !!

          ********************************************************************************

          Requirements should be satisfied by a PEP 517 installer.

          If you are using pip, you can try `pip install --use-pep517`.

          ********************************************************************************

  !!

    dist.fetch_build_eggs(dist.setup_requires)

  error: Multiple top-level packages discovered in a flat-layout: ['sktime', 'build_tools', 'extension_templates'].

  To avoid accidental inclusion of unwanted files or directories,

  setuptools will not proceed with this build.

  If you are trying to create a single distribution with multiple packages

  on purpose, you should not rely on automatic discovery.

  Instead, consider the following options:

  1. set up custom discovery (`find` directive with `include` or `exclude`)

  2. use a `src-layout`

  3. explicitly set `py_modules` or `packages` with a list of names

  To find more information, look for "package discovery" on setuptools docs.

  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

error: metadata-generation-failed

× Encountered error while generating package metadata.

╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.

hint: See above for details.

Best,

Hamid

From: Oliver Cliff @.> Sent: Thursday, September 28, 2023 9:43 PM To: olivercliff/pyspi @.> Cc: Hamid Sediqi @.>; Comment @.> Subject: Re: [olivercliff/pyspi] Cannot install PySPI on Win10 (Issue #15)

Hi there,

I haven't seen that error before but it seems like a common issue when using conda https://saturncloud.io/blog/solving-the-python-setuppy-egginfo-error-in-anaconda-a-guide/#:~:text=The%20%E2%80%9Cpython%20setup.py%20egg_info%E2%80%9D%20error%20can%20be%20frustrating,your%20Python%20module%20in%20Anaconda . Have you updated setuptools as well as pip?

It seems there also might be more output after the exit code (41 lines of output), could you paste those here if updating setuptools does not work.

— Reply to this email directly, view it on GitHub https://github.com/olivercliff/pyspi/issues/15#issuecomment-1740199418 , or unsubscribe https://github.com/notifications/unsubscribe-auth/APULR2HHLUUS7C6RMXC5F4DX4YRSJANCNFSM6AAAAAAQDH7ORY . You are receiving this because you commented. https://github.com/notifications/beacon/APULR2DZJTNKPRAFEKTYJNLX4YRSJA5CNFSM6AAAAAAQDH7OR2WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTHXFK7U.gif Message ID: @. @.> >

anniegbryant commented 11 months ago

Hi Hamid, can you try adding the following line to setup.py in your cloned pyspi repo (based on reports that this helps on stack overflow):

py_modules=[]

You can add it to line 91 of setup.py, right after extras_require={'testing': testing_extras, 'docs': docs_extras}. Once you add that line, try running python3 -m pip install . from your pyspi folder and see if that resolves the issue -- let us know if that works!

HamidSediqi commented 11 months ago

Hi Annie,

Thanks for your email. So, I’ve tried doing as you suggested, but am getting the following error:

Collecting sktime==0.8.0 (from pyspi==0.4.0)

Using cached sktime-0.8.0.tar.gz (9.7 MB)

Preparing metadata (setup.py) ... error

error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.

│ exit code: 1

╰─> [41 lines of output]

  C:\Users\hsediq01\AppData\Local\Temp\pip-install-84bf2k36\sktime_80dfebca63d8418b93ed0d16cd38f75b\setup.py:20: DeprecationWarning: pkg_resources is deprecated as an API. See  <https://setuptools.pypa.io/en/latest/pkg_resources.html> https://setuptools.pypa.io/en/latest/pkg_resources.html

    from pkg_resources import parse_version

  C:\Users\hsediq01\AppData\Local\anaconda3\envs\pyspi\lib\site-packages\setuptools\dist.py:498: SetuptoolsDeprecationWarning: Invalid dash-separated options

  !!

          ********************************************************************************

          Usage of dash-separated 'description-file' will not be supported in future

          versions. Please use the underscore name 'description_file' instead.

          This deprecation is overdue, please update your project and remove deprecated

          calls to avoid build errors in the future.

          See  <https://setuptools.pypa.io/en/latest/userguide/declarative_config.html> https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.

          ********************************************************************************

  !!

    opt = self.warn_dash_deprecation(opt, section)

  C:\Users\hsediq01\AppData\Local\anaconda3\envs\pyspi\lib\site-packages\setuptools\__init__.py:80: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.

  !!

          ********************************************************************************

          Requirements should be satisfied by a PEP 517 installer.

          If you are using pip, you can try `pip install --use-pep517`.

          ********************************************************************************

  !!

    dist.fetch_build_eggs(dist.setup_requires)

  error: Multiple top-level packages discovered in a flat-layout: ['sktime', 'build_tools', 'extension_templates'].

  To avoid accidental inclusion of unwanted files or directories,

  setuptools will not proceed with this build.

  If you are trying to create a single distribution with multiple packages

  on purpose, you should not rely on automatic discovery.

  Instead, consider the following options:

  1. set up custom discovery (`find` directive with `include` or `exclude`)

  2. use a `src-layout`

  3. explicitly set `py_modules` or `packages` with a list of names

  To find more information, look for "package discovery" on setuptools docs.

  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

error: metadata-generation-failed

× Encountered error while generating package metadata.

╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.

hint: See above for details.

Best,

Hamid

From: Annie G. Bryant @.> Sent: Monday, October 2, 2023 7:55 AM To: olivercliff/pyspi @.> Cc: Hamid Sediqi @.>; Comment @.> Subject: Re: [olivercliff/pyspi] Cannot install PySPI on Win10 (Issue #15)

Hi Hamid, can you try adding the following line to setup.py in your cloned pyspi repo (based on reports that this helps on stack overflow https://stackoverflow.com/a/72547402 ):

py_modules=[]

You can add it to line 91 of setup.py, right after extras_require={'testing': testing_extras, 'docs': docs_extras}. Once you add that line, try running python3 -m pip install . from your pyspi folder and see if that resolves the issue -- let us know if that works!

— Reply to this email directly, view it on GitHub https://github.com/olivercliff/pyspi/issues/15#issuecomment-1742879056 , or unsubscribe https://github.com/notifications/unsubscribe-auth/APULR2HMEKF4EAQ3PTJ7FBTX5KTRBAVCNFSM6AAAAAAQDH7OR2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBSHA3TSMBVGY . You are receiving this because you commented. https://github.com/notifications/beacon/APULR2CK6VWCWT7A7N4ZLYLX5KTRBA5CNFSM6AAAAAAQDH7OR2WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTH4I4VA.gif Message ID: @. @.> >

jmoo2880 commented 9 months ago

@HamidSediqi May I ask which version of python you are running? I managed to successfully install pyspi on Windows 10 using a conda environment with python version 3.8.0 as per @rmzargar's suggestion.