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 installing cDNA_Cupcake #208

Closed
ChangqingW opened this issue Jul 24, 2023 · 18 comments
Closed

Error installing cDNA_Cupcake #208

ChangqingW opened this issue Jul 24, 2023 · 18 comments
Labels
bug Something isn't working Installation Installation-related issues

Comments

@ChangqingW
Copy link

When installing the cDNA_Cupcake with

git clone https://github.com/Magdoll/cDNA_Cupcake.git
cd cDNA_Cupcake
python setup.py build

as specified in "Dependencies and installation", I got the following error:

Compiling cupcake/tofu/branch/intersection_unique.pyx because it changed.
Compiling cupcake/tofu/branch/c_branch.pyx because it changed.
Compiling cupcake/ice/find_ECE.pyx because it changed.
[1/3] Cythonizing cupcake/ice/find_ECE.pyx
/stornext/Home/data/allstaff/w/wang.ch/mambaforge/envs/sqanti3/lib/python3.10/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /vast/scratch/users/wang.ch/tmp/cDNA_Cupcake/cupcake/ice/find_ECE.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
[2/3] Cythonizing cupcake/tofu/branch/c_branch.pyx
/stornext/Home/data/allstaff/w/wang.ch/mambaforge/envs/sqanti3/lib/python3.10/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /vast/scratch/users/wang.ch/tmp/cDNA_Cupcake/cupcake/tofu/branch/c_branch.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)

Error compiling Cython file:
------------------------------------------------------------
...
                exon_tree.insert_interval(Interval(e_start+offset, i+offset, index))
                index += 1
                tag = False
            elif baseC[i] > 0 and (altC_pos[i] > threshSplit or altC_neg[i+1] < -threshSplit): # alt. junction found!
                # end the current exon at i and start a new one at i + 1
                print "alt. junction found at", i
                      ^
------------------------------------------------------------

cupcake/tofu/branch/c_branch.pyx:30:22: Syntax error in simple statement list
Traceback (most recent call last):
  File "/vast/scratch/users/wang.ch/tmp/cDNA_Cupcake/setup.py", line 25, in <module>
    ext_modules = cythonize(ext_modules),
  File "/stornext/Home/data/allstaff/w/wang.ch/mambaforge/envs/sqanti3/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1134, in cythonize
    cythonize_one(*args)
  File "/stornext/Home/data/allstaff/w/wang.ch/mambaforge/envs/sqanti3/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
    raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: cupcake/tofu/branch/c_branch.pyx

Which seems to be caused by the pyx files written in Python2 instead of Python3?

@hyeon9
Copy link

hyeon9 commented Jul 24, 2023

I also faced similar situation, have you checked you bio python version?
And then try reinstall it pip install Biopython==1.75.
In my case, I fixed it through this manner.

@majdabdul
Copy link

majdabdul commented Jul 24, 2023

I also faced similar situation, have you checked you bio python version? And then try reinstall it pip install Biopython==1.75. In my case, I fixed it through this manner.

I have the same problem. @hyeon9 , Can you please elaborate on the solution?
pip install Biopython==1.75
then what do I do? I retried python setup.py build, but still got the same error.

Thanks!

@hyeon9
Copy link

hyeon9 commented Jul 24, 2023

could you please check the you bcbio-gff or bcbiogff version?

Thanks!

@majdabdul
Copy link

could you please check the you bcbio-gff or bcbiogff version?

Thanks!

I don't seem to have it. So I did conda install bioconda bcbiogff and it went ahead without errors, but afterwards if I run which bcbiogff or bcbiogff --version, it doesn't exit. What's going on T_T

@aarzalluz aarzalluz added the bug Something isn't working label Jul 25, 2023
@aarzalluz
Copy link
Member

aarzalluz commented Jul 25, 2023

As detected by @ChangqingW, the error is caused by the language_level argument not being defined in setup.py. They submitted a PR in the cDNA_Cupcake repo (see #239) fixing the issue. I am sure that @Magdoll will merge it as soon as she can.

@majdabdul in the meantime, you can edit setup.py by changing line 25 in setup.py:

  • from ext_modules = cythonize(ext_modules),
  • to ext_modules = cythonize(ext_modules, language_level = "2"),

And then run python setup.py build again -it worked for me!

Hope that helps,

Ángeles

PS: sorry -deleted previous comment because I was able to replicate the error on my own SQANTI3 installation (v5.1.2) and decided to provide the fix directly.

@aarzalluz aarzalluz added the Installation Installation-related issues label Jul 25, 2023
@ChangqingW
Copy link
Author

Just realised that it is maintained by a different developer, sorry to have posted under the wrong repo 🙈

@aarzalluz
Copy link
Member

@ChangqingW -no worries! It's good to have the solution here anyway in case other users run into the same problem :)

I'll leave the issue open until the fix is added to the cDNA_Cupcake repo.

@majdabdul
Copy link

Thank you so much @aarzalluz, the fix works!

@skchronicles
Copy link

skchronicles commented Sep 14, 2023

I ran into a few other issues. I opened an issue with the author of cDNA_Cupcake with a description of each problem and my solution. I am building a docker image for sqanti3 using python/3.10, and I ran into this issue, an issue with the pointer to to the sklearn dependency in their setup.py (easy fix), and another issue related to the using a newer version of numpy (does not support np.int declarations).

My fixes can be found here. View my TLDR, to a set of commands that can be run to fix all the problems I have listed above:
Magdoll/cDNA_Cupcake#241

@aarzalluz
Copy link
Member

Hi @skchronicles -thank you for letting us know and posting the link to your fixes here. I suspect cDNA_Cupcake is no longer maintained, so it won't be long before these issues require more permanent solutions, but for now it is good to have them reported here.

@skchronicles
Copy link

@aarzalluz Okay, that sounds good! I ended up creating a docker image for SQANTI3/5.1.2 that contains all my patches for cDNA_Cupcake here. Please let me know if you have any questions or if you need help with anything. Thank you again for creating this awesome tool! It has been incredibly useful for my long-read projects.

@BaiYang-HH
Copy link

BaiYang-HH commented Oct 24, 2023

I edited setup.py by changing line 25 in setup.py:

from ext_modules = cythonize(ext_modules),
to ext_modules = cythonize(ext_modules, language_level = "2"),
And then run python setup.py build again -but it didn't worke for me!

/envs/SQANTI3.env/lib/python3.10/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)
running build
running build_py
running build_ext
running build_scripts

Hope someone can help me. Thanks a lot.

@shaohuaihan
Copy link

Running sklearn-0.0.post12/setup.py -q bdist_egg --dist-dir /tmp/easy_install-l2u1gg_8/sklearn-0.0.post12/egg-dist-tmp-469ysq9t
error: Setup script exited with The 'sklearn' PyPI package is deprecated, use 'scikit-learn'
rather than 'sklearn' for pip commands.

modify setup.py again

@shaohuaihan
Copy link

/SQANTI3.env/lib/python3.10/site-packages/cupcake-29.0.0-py3.10-linux-x86_64.egg/cupcake/tofu/fusion_collate_info.py:171: SyntaxWarning: "is not" with a literal. Did you mean "!="?
'ReadCountScore': count_d[pbid]*(10**6)/total_fl_count if count_d[pbid] is not 'NA' else 'NA',

@carolinamonzo
Copy link
Contributor

I edited setup.py by changing line 25 in setup.py:

from ext_modules = cythonize(ext_modules), to ext_modules = cythonize(ext_modules, language_level = "2"), And then run python setup.py build again -but it didn't worke for me!

/envs/SQANTI3.env/lib/python3.10/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) running build running build_py running build_ext running build_scripts

Hope someone can help me. Thanks a lot.

Hi @BaiYang-HH did you figure this out?
After modifying line 25 in setup.py, I got the note on setuptools.installer, but it still complied and built correctly.

@carolinamonzo
Copy link
Contributor

Running sklearn-0.0.post12/setup.py -q bdist_egg --dist-dir /tmp/easy_install-l2u1gg_8/sklearn-0.0.post12/egg-dist-tmp-469ysq9t error: Setup script exited with The 'sklearn' PyPI package is deprecated, use 'scikit-learn' rather than 'sklearn' for pip commands.

modify setup.py again

Exactly, if that error appears, line 40 of setup.py should be changed from 'sklearn', to 'scikit-learn'. After you change that, run python setup.py build and python setup.py install again, it installs correctly :)

@carolinamonzo
Copy link
Contributor

This problem has been now solved by forking the no longer maintained cDNA_cupcake repository, making the changes necessary for installation, and updating the SQANTI installation wiki describing an installation directly from the forked repository.

@tky199996
Copy link

我通过更改 setup.py 中的第 25 行来编辑 setup.py:

从 ext_modules = cythonize(ext_modules),到 ext_modules = cythonize(ext_modules, language_level = “2”),然后运行 python setup.py 再次构建 - 但它对我不起作用!

/envs/SQANTI3.env/lib/python3.10/site-packages/setuptools/init.py:80:_DeprecatedInstaller:setuptools.installer 和 fetch_build_eggs 已弃用。 !!

    ********************************************************************************
    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) 运行构建 运行build_py运行build_ext运行build_scripts

希望有人能帮助我。多谢。
Pls did you solve this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Installation Installation-related issues
Projects
None yet
Development

No branches or pull requests

9 participants