{"action":"created","issue":{"url":"https://api.github.com/repos/taoliu/MACS/issues/155","repository_url":"https://api.github.com/repos/taoliu/MACS","labels_url":"https://api.github.com/repos/taoliu/MACS/issues/155/labels{/name}","comments_url":"https://api.github.com/repos/taoliu/MACS/issues/155/comments","events_url":"https://api.github.com/repos/taoliu/MACS/issues/155/events","html_url":"https://github.com/taoliu/MACS/issues/155","id":182637492,"number":155,"title":"MACS2 can't find python files after fresh conda install","user":{"login":"abalter","id":5349876,"avatar_url":"https://avatars.githubusercontent.com/u/5349876?v=3","gravatar_id":"","url":"https://api.github.com/users/abalter","html_url":"https://github.com/abalter","followers_url":"https://api.github.com/users/abalter/followers","following_url":"https://api.github.com/users/abalter/following{/other_user}","gists_url":"https://api.github.com/users/abalter/gists{/gist_id}","starred_url":"https://api.github.com/users/abalter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abalter/subscriptions","organizations_url":"https://api.github.com/users/abalter/orgs","repos_url":"https://api.github.com/users/abalter/repos","events_url":"https://api.github.com/users/abalter/events{/privacy}","received_events_url":"https://api.github.com/users/abalter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-12T21:21:56Z","updated_at":"2016-11-11T18:46:22Z","closed_at":null,"body":"I install `macs2` using `conda` and `which` can find it, but MACS2 throws errors when I try to run it about not being able to find files.\n\n```\nbalter@server:~$ conda install macs2\nFetching package metadata ...........\nSolving package specifications: ..........\n\nPackage plan for installation in environment <server path>/users/balter/miniconda2:\n\nThe following NEW packages will be INSTALLED:\n\n    macs2: 2.1.1.20160309-r3.2.2_0 bioconda\n\nProceed ([y]/n)? y\n\nLinking packages ...\n[      COMPLETE      ]|###########################################################################################| 100%\nbalter@server:~$ which macs2\n<server path>/users/balter/miniconda2/bin/macs2\nbalter@server:~$ macs2 -h\nTraceback (most recent call last):\n  File \"<server path>/users/balter/miniconda2/bin/macs2\", line 4, in <module>\n    __import__('pkg_resources').run_script('MACS2==2.1.1.20160309', 'macs2')\n  File \"<server path>/users/balter/miniconda2/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/__init__.py\", line 719, in run_script\n  File \"<server path>/users/balter/miniconda2/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/__init__.py\", line 1496, in run_script\npkg_resources.ResolutionError: No script named 'macs2'\nbalter@server:~$ macs2 --version\nTraceback (most recent call last):\n  File \"<server path>/users/balter/miniconda2/bin/macs2\", line 4, in <module>\n    __import__('pkg_resources').run_script('MACS2==2.1.1.20160309', 'macs2')\n  File \"<server path>/users/balter/miniconda2/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/__init__.py\", line 719, in run_script\n  File \"<server path>/users/balter/miniconda2/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/__init__.py\", line 1496, in run_script\npkg_resources.ResolutionError: No script named 'macs2'\n```\n\nI'm wondering if it has something to do with my python path settings. Here they are:\n\n```\nbalter@server:~$ grep -i python* .bashrc\n# Python environment variables\nexport PYTHONLIB=\"<server path>/users/balter/miniconda2/lib\"\nexport PYTHONPATH=\"<server path>/users/balter/miniconda2/lib/python2.7/site-packages\"\nexport PYTHONUSERBASE=\"<server path>/users/balter/miniconda2\"\n\nbalter@server:~$ grep -i path .bashrc\n# Custom PATH variable\nexport PATH=\"/bin:/usr/local/bin:/usr/bin:/opt/condor/bin:<server path>/CompBio/bin\"\nexport PATH=\"<server path>/users/balter/miniconda2/bin:$PATH\"\n```\n\nCross-posted here:\nhttps://www.biostars.org/p/216312/\nand here:\nhttp://stackoverflow.com/questions/40008344/macs2-python-files-not-found-after-clean-install-with-conda\n"},"comment":{"url":"https://api.github.com/repos/taoliu/MACS/issues/comments/260026552","html_url":"https://github.com/taoliu/MACS/issues/155#issuecomment-260026552","issue_url":"https://api.github.com/repos/taoliu/MACS/issues/155","id":260026552,"user":{"login":"taoliu","id":593654,"avatar_url":"https://avatars.githubusercontent.com/u/593654?v=3","gravatar_id":"","url":"https://api.github.com/users/taoliu","html_url":"https://github.com/taoliu","followers_url":"https://api.github.com/users/taoliu/followers","following_url":"https://api.github.com/users/taoliu/following{/other_user}","gists_url":"https://api.github.com/users/taoliu/gists{/gist_id}","starred_url":"https://api.github.com/users/taoliu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taoliu/subscriptions","organizations_url":"https://api.github.com/users/taoliu/orgs","repos_url":"https://api.github.com/users/taoliu/repos","events_url":"https://api.github.com/users/taoliu/events{/privacy}","received_events_url":"https://api.github.com/users/taoliu/received_events","type":"User","site_admin":false},"created_at":"2016-11-11T18:46:22Z","updated_at":"2016-11-11T18:46:22Z","body":"Hi @abalter, could you find out where the 'conda' installed MACS2? Especially, where is the 'egg' for MACS2? According to my knowledge of 'easyinstall', it will package actual python scripts (macs2) and the library files (such as .pyc or .o files)  in 'egg' then put it somewhere (such as <server path>/users/balter/miniconda2/lib/python2.7/site-packages/). Then it will create a virtual script (such as <server path>/users/balter/miniconda2/bin/macs2) and instruct the system where the egg is. To find the egg, it will look for a file named 'easy-install.pth' and in that file there must be a line like 'somepath/MACS2-2.1.1.20160309-py2.7-xxxxxxxxx.egg' (the egg is in fact a directory). Python will try to insert 'somepath/MACS2-2.1.1.20160309-py2.7-xxxxxxxxx.egg' to sys.path so that it will locate the actual 'macs2' script and its library files. The actual 'macs2' script should be in 'xxx.egg/EGG-INFO/scripts/macs2', and library files should be in 'xxx.egg/MACS2/'. Yes. It's so complicated and I really hate that :) The conclusion is... if you installed python package in this way -- through easyinstall (the setup tools), your hack on PYTHONPATH will not be that useful anymore! So, try not to use PYTHONPATH if your python software is installed through this 'conda' script. Instead, try to figure out where the .pth and .egg are and to check if conda successfully write a line about 'MACS2' in the .pth file..."}}
{"actor":{"display_login":"taoliu"}}