opened
fanyucai1
username_0
hi doctor, my script as follows:
##################################
from civicpy import civic, exports
with open('civic_variants.vcf', 'w', newline='') as file:
        w = exports.VCFWriter(file)
        all_variants = civic.get_all_variants()
        w.addrecords(all_variants)
        w.writerecords()
###########################the erro:
Traceback (most recent call last):
  File "VEP.py", line 1, in <module>
    from civicpy import civic, exports
ImportError: cannot import name 'exports'

what should I do?
run erro
issue
created
ahwagner
username_1
Hi @username_0. Would you kindly provide us with the version of CIViCpy you are using that produced this error?
comment
created
fanyucai1
username_0
hi doctor, I change my python from 3.6 to 3.7. The erro changed as follows:
WARNING:root:Getting all genes. This may take a couple of minutes...
Traceback (most recent call last):
  File "test.py", line 6, in <module>
    w.addrecords(all_variants)
  File "/usr/local/lib/python3.7/site-packages/civicpy/exports.py", line 122, in addrecords
    self.addrecord(record)
  File "/usr/local/lib/python3.7/site-packages/civicpy/exports.py", line 112, in addrecord
    self.addrecord(evidence)
  File "/usr/local/lib/python3.7/site-packages/civicpy/exports.py", line 114, in addrecord
    valid = self._validate_evidence_record(civic_record)
  File "/usr/local/lib/python3.7/site-packages/civicpy/exports.py", line 235, in _validate_evidence_record
    valid = self._validate_sequence_variant(variant)
  File "/usr/local/lib/python3.7/site-packages/civicpy/exports.py", line 272, in _validate_sequence_variant
    valid = self._validate_coordinates(variant, types)
  File "/usr/local/lib/python3.7/site-packages/civicpy/exports.py", line 332, in _validate_coordinates
    raise NotImplementedError(f'No logic to handle {variant_type.name} {variant}')
NotImplementedError: No logic to handle transcript_fusion <CIViC variant 2663>
#####################
what should I do?
comment
created
ahwagner
username_1
To help you troubleshoot this problem, please provide the version _of CIViCpy_ that you are using. You may find this by using `pip freeze | grep civicpy` in your shell.
comment
created
fanyucai1
username_0
civicpy==0.0.3.post1
comment
created
susannasiebert
username_2
Please upgrade to version `1.0.0rc2` by running `pip install civicpy==1.0.0rc2`.
comment
created
fanyucai1
username_0
the erro as follows:
Traceback (most recent call last):
  File "get_civicpy.py", line 5, in <module>
    all_variants = civic.get_all_variants()
  File "/usr/local/lib/python3.7/site-packages/civicpy/civic.py", line 820, in get_all_variants
    variants = _get_elements_by_ids('variant', allow_cached=allow_cached, get_all=True)
  File "/usr/local/lib/python3.7/site-packages/civicpy/civic.py", line 661, in _get_elements_by_ids
    load_cache()
  File "/usr/local/lib/python3.7/site-packages/civicpy/civic.py", line 168, in load_cache
    old_cache = pickle.load(pf)
_pickle.UnpicklingError: pickle data was truncated
comment
created
fanyucai1
username_0
I find one file called: cache.pkl,where can I download this file?
comment
created
ahwagner
username_1
Closing this issue; stale. For reference, a fresh cache.pkl file should be automatically grabbed from live CIViC in civicpy v1.0 and above.
comment
closed
ahwagner
username_1
issue