Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enum_type_wrapper ImportError for ray #229

Closed
chenyangkang opened this issue Jan 25, 2024 · 1 comment
Closed

enum_type_wrapper ImportError for ray #229

chenyangkang opened this issue Jan 25, 2024 · 1 comment

Comments

@chenyangkang
Copy link

chenyangkang commented Jan 25, 2024

Hi I was running swift on my mac m1 with python 3.9. Looks like something wrong with ray.

This occur when I call import swift
ImportError: cannot import name 'enum_type_wrapper' from 'google.protobuf.internal' (unknown location)

ray version: 2.9.1
swifter version: 1.4.0

Full signal:


ImportError Traceback (most recent call last)
Cell In[11], line 1
----> 1 import swifter
2 swifter.version

File ~/miniforge3/lib/python3.9/site-packages/swifter/init.py:5
3 import warnings
4 from logging import config
----> 5 from .swifter import SeriesAccessor, DataFrameAccessor, set_defaults
6 from .parallel_accessor import (
7 register_parallel_dataframe_accessor,
8 register_parallel_series_accessor,
9 register_modin,
10 )
12 warnings.filterwarnings("ignore", category=FutureWarning)

File ~/miniforge3/lib/python3.9/site-packages/swifter/swifter.py:555
547 raise NotImplementedError(
548 "Ray is required for groupby apply functionality."
549 "Please install ray before continuing and then restart your script or kernel."
550 )
553 if RAY_INSTALLED: # noqa: C901
--> 555 class GroupBy(DataFrameAccessor):
556 import ray
558 def init(
559 self,
560 pandas_obj,
(...)
567 **grpby_kwargs,
568 ):

File ~/miniforge3/lib/python3.9/site-packages/swifter/swifter.py:556, in GroupBy()
555 class GroupBy(DataFrameAccessor):
--> 556 import ray
558 def init(
559 self,
560 pandas_obj,
(...)
567 **grpby_kwargs,
568 ):
569 super(GroupBy, self).init(
570 pandas_obj,
571 npartitions=npartitions,
(...)
574 progress_bar_desc=progress_bar_desc,
575 )

File ~/miniforge3/lib/python3.9/site-packages/ray/init.py:84
81 commit = _version.commit
82 version = _version.version
---> 84 import ray._raylet # noqa: E402
86 from ray._raylet import ( # noqa: E402,F401
87 ActorClassID,
88 ActorID,
(...)
101 PlacementGroupID,
102 )
104 _config = _Config()

File python/ray/_raylet.pyx:169, in init ray._raylet()

File ~/miniforge3/lib/python3.9/site-packages/ray/exceptions.py:10
8 import ray.cloudpickle as pickle
9 from ray._raylet import ActorID, TaskID, WorkerID
---> 10 from ray.core.generated.common_pb2 import (
11 PYTHON,
12 ActorDiedErrorContext,
13 Address,
14 Language,
15 RayException,
16 )
17 from ray.util.annotations import DeveloperAPI, PublicAPI
19 import setproctitle

File ~/miniforge3/lib/python3.9/site-packages/ray/core/generated/common_pb2.py:5
1 # -- coding: utf-8 --
2 # Generated by the protocol buffer compiler. DO NOT EDIT!
3 # source: src/ray/protobuf/common.proto
4 """Generated protocol buffer code."""
----> 5 from google.protobuf.internal import enum_type_wrapper
6 from google.protobuf import descriptor as _descriptor
7 from google.protobuf import descriptor_pool as _descriptor_pool

ImportError: cannot import name 'enum_type_wrapper' from 'google.protobuf.internal' (unknown location)

@chenyangkang
Copy link
Author

Turned out to be an issue of protobuf

pip uninstall protobuf

then

pip install protobuf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant