Comments (4)
When calling sierralocal
by absolute path, I run into the following issue:
is2882:sierra-local art$ /opt/local/Library/Frameworks/Python.framework/Versions/3.5/bin/sierralocal
3.5.5 (default, Feb 5 2018, 07:16:39)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)]
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/bin/sierralocal", line 12, in <module>
sys.exit(main())
TypeError: 'module' object is not callable
I encountered the same problem when building sierra-local from source in Ubuntu 18.04.1.
The problem is that main
is being imported as a module, so the correct call would be main.main()
.
Since the sierralocal
script is generated by setup.py
, we have to modify the latter somehow.
from sierra-local.
Apparently the weird /opt
path is expected behaviour from distutils, so we'll have to ignore that problem and require users to modify their PATH
variable.
Changing main()
to main.main()
as above fixes the problem for macOS, but now we get this problem in Linux:
art@orolo:~/git/sierra-local$ sierralocal
3.6.5 (default, Apr 1 2018, 05:46:30)
[GCC 7.3.0]
Traceback (most recent call last):
File "/usr/local/bin/sierralocal", line 12, in <module>
sys.exit(main.main())
AttributeError: 'function' object has no attribute 'main'
art@orolo:~/git/sierra-local$ cat /usr/local/bin/sierralocal
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from sierralocal import main
if __name__ == '__main__':
print(sys.version)
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main.main())
from sierra-local.
This is weird:
art@orolo:~/git/sierra-local$ bin/sierralocal
3.6.5 (default, Apr 1 2018, 05:46:30)
[GCC 7.3.0]
<function main at 0x7fb8867ead90> # output of print(main)
Traceback (most recent call last):
File "bin/sierralocal", line 13, in <module>
sys.exit(main.main())
AttributeError: 'function' object has no attribute 'main'
art@orolo:~/git/sierra-local$ python3
Python 3.6.5 (default, Apr 1 2018, 05:46:30)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from sierralocal import main
>>> main
<module 'sierralocal.main' from '/home/art/git/sierra-local/sierralocal/main.py'>
So sierralocal
called via CLI loads the function and not the module, and calling it within a Python interpreter loads the module and not the function.
from sierra-local.
Turns out this weirdness was being caused by an older installation of sierralocal in ~/.local
, which would have resulted from calling setup.py
without sudo
privileges. I nuked this instance and things seem back to normal. Will remove gross try..except
hack from bin/sierralocal
if things stay normal.
from sierra-local.
Related Issues (20)
- Subtyper module HOT 2
- Fail to run with iupac codes HOT 19
- TypeError, when testing `score_single` function in ./sierralocal/score_alg.py HOT 1
- RuntimeError, when testing `HIVdb.set_hivdb_xml` method in ./sierralocal/hivdb.py HOT 1
- AttributeError, when testing `parse_definitions`, `parse_drugs` and `parse_comments` HOT 1
- Issue with `scorerange` parameter of `parse_globalrange` method HOT 3
- Issue when testing `align_file` method of `NucAminoAligner` HOT 1
- issue while testing `update_hivdb` function of `updater.py`
- Test coverage improvement issue for `get_closest_subtype` function of `subtyper.py` HOT 3
- Add postalign as a submodule
- Missing required dependencies: cython==0.29.32, postalign @ https://github.com/hivdb/post-align HOT 8
- Subtyping HOT 2
- postalign vs nucamino HOT 11
- setup.py and postalign HOT 2
- DOR resistance level HOT 3
- Missing T69S_SS (T69ins) mutation HOT 10
- TypeError: unsupported operand type(s) for -: 'int' and 'NoneType' HOT 2
- JSON to CSV conversion Error: json2csv.py HOT 5
- Unkown subtype HOT 6
- NRTI resistance profile HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sierra-local.