I was trying to install Imfit library using pip3 install pyimfit on an Intel Mac and this is the error i've got from Jupyter when trying to run import pyimfit
ImportError Traceback (most recent call last)
Input In [1], in <cell line: 1>()
----> 1 import pyimfit as im
2 import scipy as sc
3 import numpy as np
File /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyimfit/init.py:4, in <module>
1 # This file defines what is visible to the outside world when the package
2 # (pyimfit) is imported
3 from .descriptions import *
----> 4 from .pyimfit_lib import convolve_image, make_imfit_function, ModelObjectWrapper # type: ignore
5 from .pyimfit_lib import FixImage
6 from .pyimfit_lib import PsfOversampling
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyimfit/pyimfit_lib.cpython-39-darwin.so, 2): Symbol not found: ZTTNSt3114basic_ifstreamIcNS_11char_traitsIcEEEE
Referenced from: /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyimfit/pyimfit_lib.cpython-39-darwin.so
Expected in: /usr/lib/libc++.1.dylib
in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyimfit/pyimfit_lib.cpython-39-darwin.so
I've tried reinstalling it through pip numerous times but to no avail. Also tried reinstalling Numpy/Scipy as those are the dependency for Imfit but also no luck. Any ideas how to fix this problem?
I am trying to import biluo_tags_from_offsets from spacy.gold but cannot do it.
Getting ModuleNotFoundError.
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-21-d17a54331c7a> in <module>
3
4 import spacy
----> 5 from spacy.gold import biluo_tags_from_offsets
6 nlp = spacy.load("en_core_web_lg")
7
ModuleNotFoundError: No module named 'spacy.gold'
How can I use this spacy.gold module. I have already installed spacy.
I am an amateur, sorry if this question does not make any sense.
Any kind of help is appreciated.
Thanks!
As the documentation says, spacy.gold was disabled in spaCy 3.0. If you have the latest spaCy version, that is why you are getting this error.
You need to replace from spacy.gold import biluo_tags_from_offsets with from spacy.training import offsets_to_biluo_tags.
I am attempting to use the tensorflow object classifier and am having some slight issues when it comes to importing the models.
I am following a tutorial (https://gilberttanner.com/blog/installing-the-tensorflow-object-detection-api) and from what I seen on google alot of others have had similar issues regarding the import.
Having downloaded TensorFlow/models, pycocotools, I have then installed protobuf, I managed to run it and convert the PROTO files to Python Source file - I thought I was on the home stretch here.
But when running through the object_detector tutorial I get so far before I run into this importerror
---------------------------------------------------------------------------
`ImportError Traceback (most recent call last)
<ipython-input-10-962ae4a715f3> in <module>
1 from object_detection.utils import ops as utils_ops
----> 2 from object_detection.utils import label_map_util
3 from object_detection.utils import visualization_utils as vis_util
4 from protos import string_int_label_map_pb2
c:\users\robert\appdata\local\programs\python\python38\lib\site-packages\object_detection\utils\label_map_util.py in <module>
19 import tensorflow as tf
20 from google.protobuf import text_format
---> 21 from object_detection.protos import string_int_label_map_pb2
22
23 enter code here`
ImportError: cannot import name 'string_int_label_map_pb2' from 'object_detection.protos'
(c:\users\robert\appdata\local\programs\python\python38\lib\site-packages\object_detection\protos\__init__.py)
I am a bit confused here - Maybe I stared at this for a bit too long..-
I can go into the files and within object_detection/protos there is a string_int_label_map_pb2
So whats going wrong?
I have looked at alot of other posted similar to this but I cannot seem to find an exact answer for what I need. I have set the pythonpath, ran python setup.py build & install. But I am stuck.
I am still new to all this, and Im sure I am being really dense and missing something obvious. But any help would be amazing.
Thank you
I am having trouble getting tensorflow to work using Jupiter notebooks. I am a complete noob so please keep responses as simple as possible and apologies if this is trivial.
I run the following code in the notebook:
import tensorflow as tf
from tensorflow.python.framework import ops
And get this error message:
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-15-509396287076> in <module>()
1
2 import tensorflow as tf
----> 3 from tensorflow.python.framework import ops
4 from tf_utils import load_dataset, random_mini_batches, convert_to_one_hot, predict
5
ModuleNotFoundError: No module named 'tensorflow.python'
(I originally struggled to get the "import tensorflow as tf" line to work but have resolved that. The code runs fine without the second line...)
Thanks for your help!
I was using python's datashader 0.5.0 package to plot population density information, generally following the tutorial https://www.continuum.io/blog/developer-blog/analyzing-and-visualizing-big-data-interactively-your-laptop-datashading-2010-us . I installed datashader using conda install -c bokeh datashader=0.5.0.
All was fine. Though perhaps unrelated, things seemed to break as soon as I installed the haloviews and geoviews packages. After installing these additional packages, I can no longer import datashader and my once working code no longer runs. When importing datashader, I get the following error:
AttributeError: module 'snappy' has no attribute 'compress'
I am running on windows 10, anaconda python 3.5.3.
Perhaps I'm going down the wrong rabbit hole, but I thought perhaps it was the snappy package. I ran "conda install -c conda-forge snappy=1.1.4". conda list reveals that snappy is installed. Snappy does import. The snappy.compress object is not found. My issue seems related to the following SO post as I also had a fastparquet error when trying geoviews: error with snappy while importing fastparquet in python
When running import snappy, print(snappy.__filename__) gives the following error:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-5-b8565733b383> in <module>()
----> 1 import snappy; print(snappy.__file__)
AttributeError: module 'snappy' has no attribute '__file__'
I also tried uninstalling through both conda and pip just in case. Still no joy.
Running "pip install python-snappy" results in a "failed building wheel for python-snappy" error preceded with " error: Microsoft Visual C++ 14.0 is required..." So I went and got the "Microsoft Visual C++ Redistributable for Visual Studio 2017" and ran it, but had no change.
Any thoughts on how to resolve this? For reference, the full error on datashader import is as follows:
--------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-7-3d7b1ff9e530> in <module>()
----> 1 import datashader
C:\Python\lib\site-packages\datashader\__init__.py in <module>()
3 __version__ = '0.5.0'
4
----> 5 from .core import Canvas
6 from .reductions import (count, any, sum, min, max, mean, std, var, count_cat,
7 summary)
C:\Python\lib\site-packages\datashader\core.py in <module>()
3 import numpy as np
4 from datashape.predicates import istabular
----> 5 from odo import discover
6 from xarray import DataArray
7
C:\Python\lib\site-packages\odo\__init__.py in <module>()
63 from .backends.url import URL
64 with ignoring(ImportError):
---> 65 from .backends.dask import dask
66
67
C:\Python\lib\site-packages\odo\backends\dask.py in <module>()
8
9 from dask.array.core import Array, from_array
---> 10 from dask.bag.core import Bag
11 import dask.bag as db
12 from dask.compatibility import long
C:\Python\lib\site-packages\dask\bag\__init__.py in <module>()
1 from __future__ import absolute_import, division, print_function
2
----> 3 from .core import (Bag, Item, from_sequence, from_url, to_textfiles, concat,
4 from_delayed, map_partitions, bag_range as range,
5 bag_zip as zip, bag_map as map)
C:\Python\lib\site-packages\dask\bag\core.py in <module>()
30
31 from ..base import Base, normalize_token, tokenize
---> 32 from ..bytes.core import write_bytes
33 from ..compatibility import apply, urlopen
34 from ..context import _globals, defer_to_globals
C:\Python\lib\site-packages\dask\bytes\__init__.py in <module>()
2
3 from ..utils import ignoring
----> 4 from .core import read_bytes, open_files, open_text_files
5
6 from . import local
C:\Python\lib\site-packages\dask\bytes\core.py in <module>()
7 from warnings import warn
8
----> 9 from .compression import seekable_files, files as compress_files
10 from .utils import (SeekableFile, read_block, infer_compression,
11 infer_storage_options, build_name_function)
C:\Python\lib\site-packages\dask\bytes\compression.py in <module>()
30 with ignoring(ImportError):
31 import snappy
---> 32 compress['snappy'] = snappy.compress
33 decompress['snappy'] = snappy.decompress
34
AttributeError: module 'snappy' has no attribute 'compress'
It turns out that in adding packages, something messed up the snappy install. I followed this solution: How to install snappy C libraries on Windows 10 for use with python-snappy in Anaconda?
It was a snappy error, not a datashader issue, but I'll leave the post in case anyone has the same series of issues.