Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'plot_fpca_perturbation_graphs' from 'skfda.exploratory.visualization' ; ImportError: cannot import name 'FPCA' from 'skfda.preprocessing.dim_reduction.projection' #247

Closed
rorondre opened this issue Jul 23, 2020 · 4 comments
Labels

Comments

@rorondre
Copy link

rorondre commented Jul 23, 2020

Describe the bug
When importing functions from 'skfda.exploratory.visualization', I get an import error:

ImportError: cannot import name 'plot_fpca_perturbation_graphs' from 'skfda.exploratory.visualization'

The same holds for FPCA in 'skfda.preprocessing.dim_reduction.projection' :

ImportError: cannot import name 'FPCA' from 'skfda.preprocessing.dim_reduction.projection'

I have downloaded the package with

pip install scikit-fda

and I was trying to follow the documentation for Functional Principal Component Analysis here (https://fda.readthedocs.io/en/latest/auto_examples/plot_fpca.html#sphx-glr-auto-examples-plot-fpca-py), but I get errors on the import statements

To Reproduce
Code to reproduce the behavior:

import skfda
from skfda.exploratory.visualization import plot_fpca_perturbation_graphs
...

and

import skfda
from skfda.preprocessing.dim_reduction.projection import FPCA
...

Expected behavior
I am expecting the import statements to work as in the documentation

Version information

  • OS: Windows
  • Python version: 3.8
  • scikit-fda version: 0.3

Additional context
Are you planning on releasing the current version from the develop branch anytime soon? I have also tried to install the latest version of the package, but then I get the import error for skfda, even though I can see the package installed in anaconda3\envs\my_env\Lib\site-packages\skfda . Thank you!

@rorondre rorondre added the bug label Jul 23, 2020
@vnmabus
Copy link
Member

vnmabus commented Jul 23, 2020

I have released a new version (0.4) of scikit-fda in PyPI. Sorry for uploading versions with such low frequency! I will try to do it in a more regular fashion in the future.

The default documentation page is that of the latest (develop) version. The master documentation is in the "stable" URL: https://fda.readthedocs.io/en/stable/. Again, sorry if that was confusing.

Please, confirm that the currently released version works for you, in order to close this issue.

@rorondre
Copy link
Author

Thank you for your quick response and release! I don't know why but I get

import skfda
ModuleNotFoundError: No module named 'optimum_reparam'

I have used pip install scikit-fda from inside my conda environment. The issue appears similar to '#196', but the fix in that case didn't work for me. I have cython 0.29.21 installed as part of the installation of scikit-fda.

Any advice on how to proceed? Thanks.

@vnmabus
Copy link
Member

vnmabus commented Jul 26, 2020

I tried to reproduce the error in a conda environment in Windows, but I could not.

I tried to create a new conda environment and activate it:

>conda create -n test_skfda_04 python=3.8
>conda activate test_skfda_04

The default installed packages where:

>conda list
# Name                    Version                   Build  Channel
ca-certificates           2020.6.24                     0
certifi                   2020.6.20                py38_0
openssl                   1.1.1g               he774522_0
pip                       20.1.1                   py38_1
python                    3.8.3                he1778fa_2
setuptools                49.2.0                   py38_0
sqlite                    3.32.3               h2a8f88b_0
vc                        14.1                 h0510ff6_4
vs2015_runtime            14.16.27012          hf0eaf9b_3
wheel                     0.34.2                   py38_0
wincertstore              0.2                      py38_0
zlib                      1.2.11               h62dcd97_4

The installation was performed with no errors:

>pip install scikit-fda

The packages after the installation where:

>conda list
# Name                    Version                   Build  Channel
ca-certificates           2020.6.24                     0
certifi                   2020.6.20                py38_0
cycler                    0.10.0                   pypi_0    pypi
cython                    0.29.21                  pypi_0    pypi
findiff                   0.8.3                    pypi_0    pypi
joblib                    0.16.0                   pypi_0    pypi
kiwisolver                1.2.0                    pypi_0    pypi
matplotlib                3.3.0                    pypi_0    pypi
mpldatacursor             0.7.1                    pypi_0    pypi
multimethod               1.3                      pypi_0    pypi
numpy                     1.19.1                   pypi_0    pypi
openssl                   1.1.1g               he774522_0
pandas                    1.0.5                    pypi_0    pypi
pillow                    7.2.0                    pypi_0    pypi
pip                       20.1.1                   py38_1
pyparsing                 2.4.7                    pypi_0    pypi
python                    3.8.3                he1778fa_2
python-dateutil           2.8.1                    pypi_0    pypi
pytz                      2020.1                   pypi_0    pypi
rdata                     0.2.1                    pypi_0    pypi
scikit-datasets           0.1.38                   pypi_0    pypi
scikit-fda                0.4                      pypi_0    pypi
scikit-learn              0.23.1                   pypi_0    pypi
scipy                     1.5.2                    pypi_0    pypi
setuptools                49.2.0                   py38_0
six                       1.15.0                   pypi_0    pypi
sqlite                    3.32.3               h2a8f88b_0
threadpoolctl             2.1.0                    pypi_0    pypi
vc                        14.1                 h0510ff6_4
vs2015_runtime            14.16.27012          hf0eaf9b_3
wheel                     0.34.2                   py38_0
wincertstore              0.2                      py38_0
xarray                    0.16.0                   pypi_0    pypi
zlib                      1.2.11               h62dcd97_4

Please, try to check if any dependency or step were different in your case. In particular, I would like to know if there was any error during the pip install step.

@rorondre
Copy link
Author

Thank you for your effort. There are no errors when I do pip install. I've repeated your steps and can open a python console from within the conda environment, where I can import skfda without a problem and try some of the examples in the documentation. The issue must be on my side with my jupyter notebook setup (the error occurs only there). I will close the issue now. Thank you again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants