dputhier / pygtftk

A python package and a set of shell commands to handle GTF files
GNU General Public License v3.0
44 stars 6 forks source link

AttributeError: module 'yaml' has no attribute 'dump' installing pygtftk #142

Closed Norisad closed 3 years ago

Norisad commented 3 years ago

I cloned the last github repository in order to install gtftk. I ran : pip install -r requirements.txt python setup.py install

Using /home/sadouni/anaconda3/envs/ologram/lib/python3.9/site-packages Finished processing dependencies for pygtftk==1.2.7.dev0+f888 Traceback (most recent call last): File "/home/sadouni/anaconda3/envs/ologram/bin/gtftk", line 4, in import('pkg_resources').run_script('pygtftk==1.2.7.dev0+f888', 'gtftk') File "/home/sadouni/anaconda3/envs/ologram/lib/python3.9/site-packages/pkg_resources/init.py", line 665, in run_script self.require(requires)[0].run_script(script_name, ns) File "/home/sadouni/anaconda3/envs/ologram/lib/python3.9/site-packages/pkg_resources/init.py", line 1463, in run_script exec(code, namespace, namespace) File "/home/sadouni/anaconda3/envs/ologram/lib/python3.9/site-packages/pygtftk-1.2.7.dev0+f888-py3.9-linux-x86_64.egg/EGG-INFO/scripts/gtftk", line 110, in args = main() File "/home/sadouni/anaconda3/envs/ologram/lib/python3.9/site-packages/pygtftk-1.2.7.dev0+f888-py3.9-linux-x86_64.egg/EGG-INFO/scripts/gtftk", line 75, in main cmd_manager = CmdManager() File "/home/sadouni/anaconda3/envs/ologram/lib/python3.9/site-packages/pygtftk-1.2.7.dev0+f888-py3.9-linux-x86_64.egg/pygtftk/cmd_manager.py", line 562, in init self.check_config_file() File "/home/sadouni/anaconda3/envs/ologram/lib/python3.9/site-packages/pygtftk-1.2.7.dev0+f888-py3.9-linux-x86_64.egg/pygtftk/cmd_manager.py", line 531, in check_config_file a_file.write(yaml.dump(out_dict, default_flow_style=False)) AttributeError: module 'yaml' has no attribute 'dump'

Installation complete.

dputhier commented 3 years ago

Hi Nory, I hope you are doing well and thank you for posting. First keep in mind that our advise is to install pygtftk through bioconda or pip (the versions are normally synchronised, currently 1.2.7). Only the develop branch (and others) may contain last but potentially very unstable code. If you try to install pygtftk using pip you will see that there is currently no version tested for python 3.9. I think that you may run into issue and I would favor '>=3.6,<3.9' (as indicated in the setup.py in __python_requires__ attribute which is unfortunately not take into account when running python setup.py install. I added issue #143 about this.

Now coming back to the issue. I guess that it is related to a PyYAML version (that we should set in requirements.tx) but did not manage to reproduce the error. On my side pygtftk installed properly under python 3.9 (although again we can't ensure that everything is working properly). What is the output of:

   pip freeze

My PyYAML is 5.4.1.

Thank you again. Best

Norisad commented 3 years ago

Thank for your answer Denis,

Actually I delete the environment and install pygtftk using conda and now it's working. Sorry I can't tell you which version were installed. But It was weird, actually I installed pygtftk with setup.py a first time. But not all features were installed (ologram was not working). So I uninstalled it, then installed it again and I got this error...

But conda solved my problem.

Thank you,

Best

qferre commented 3 years ago

Sorry to dig this up, but can we close this issue, since the use of conda solved the problem ?

dputhier commented 3 years ago

My feeling is that we would have needed more information to dig into it (for instance yaml version). Me may reopen it if someone encounter a related issue. Best