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

Error when importing the package #2

Closed
davidrm-bio opened this issue Jan 5, 2024 · 4 comments
Closed

Error when importing the package #2

davidrm-bio opened this issue Jan 5, 2024 · 4 comments

Comments

@davidrm-bio
Copy link

Hello,

Thank you for developing this package. I wanted to test it on my data, however I am running in an issue when importing it. I am using python 3.9.18 on a Mac. I get the following error when importing it:

AttributeError: module 'numpy' has no attribute 'object'.
`np.object` was a deprecated alias for the builtin `object`. To avoid this error in existing code, use `object` by itself. Doing this will not modify any behavior and is safe. 
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

Is there a preferred python version I should use?

@oubounyt
Copy link
Owner

oubounyt commented Jan 6, 2024

Hey,

Thank you for reaching out, and I appreciate your interest in our package. The issue you're encountering is related to deprecation in numpy version > 1.20.0, where the np.object alias was removed.

please use numpy version <= 1.20.0

@davidrm-bio davidrm-bio changed the title Error when imporing the package Error when importing the package Jan 17, 2024
@davidrm-bio
Copy link
Author

Thank you for your answer, I manage to install it correctly. However, after following the tutorial when running the co-expression analysis there is another problem.
The anndata object looks the same as in the tutorial:

adata_r
AnnData object with n_obs × n_vars = 450 × 29252
    obs: '__SCANclusters__'
    var: 'Genes'
    uns: 'pca', 'neighbors', 'umap'
    obsm: 'X_pca', 'X_umap'
    varm: 'PCs'
    obsp: 'distances', 'connectivities'

This is the error:


R[write to console]: Error in `map()`:
ℹ In index: 6.
ℹ With name: ylab.
Caused by error in `lifecycle::deprecate_soft()`:
! argument "user_env" is missing, with no default
Run `rlang::last_trace()` to see where the error occurred.
Traceback (most recent call last):
  File "/home/davidr/anaconda3/envs/scanet_env/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3508, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-11-dc720f102e26>", line 1, in <module>
    SFTpower = sn.co.plot_powers(adata_r, network_type='unsigned', cor_method='pearson')
  File "/home/davidr/anaconda3/envs/scanet_env/lib/python3.8/site-packages/scanet/coexpression.py", line 87, in plot_powers
    optimal_power_ = plot_power_r(final_exp_, path=cls.path_outs,network_type=network_type,
  File "/home/davidr/anaconda3/envs/scanet_env/lib/python3.8/site-packages/rpy2/robjects/functions.py", line 208, in __call__
    return (super(SignatureTranslatedFunction, self)
  File "/home/davidr/anaconda3/envs/scanet_env/lib/python3.8/site-packages/rpy2/robjects/functions.py", line 131, in __call__
    res = super(Function, self).__call__(*new_args, **new_kwargs)
  File "/home/davidr/anaconda3/envs/scanet_env/lib/python3.8/site-packages/rpy2/rinterface_lib/conversion.py", line 45, in _
    cdata = function(*args, **kwargs)
  File "/home/davidr/anaconda3/envs/scanet_env/lib/python3.8/site-packages/rpy2/rinterface.py", line 873, in __call__
    raise embedded.RRuntimeError(_rinterface._geterrmessage())
rpy2.rinterface_lib.embedded.RRuntimeError: Error in map(.l, vctrs_vec_compat) : 
ℹ With name: ylab.
Caused by error in `lifecycle::deprecate_soft()`:
! argument "user_env" is missing, with no default

@oubounyt
Copy link
Owner

Hey,

The error message you provided is related to an issue in the R. It seems that the error occurred while using the map() function. This function is often associated with the purrr package in R.

the error message indicates a problem with the lifecycle::deprecate_soft() function, and it mentions an issue related to the "user_env" argument, which is missing and has no default value.

can need to check the version of the purrr package and its dependencies in your R environment?

@davidrm-bio
Copy link
Author

Thank you I checked and re-installed all the R libraries required and it worked

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

No branches or pull requests

2 participants