camel icon indicating copy to clipboard operation
camel copied to clipboard

cant seem to start

Open joshfryart opened this issue 1 year ago • 10 comments

(camel) C:\Users\joshu\Documents\_aipython\_useful\CAMEL agnet\camel\camel\agents>python role_playing.py
Traceback (most recent call last):
  File "C:\Users\joshu\Documents\_aipython\_useful\CAMEL agnet\camel\camel\agents\role_playing.py", line 8, in <module>
    from .chat_agent import ChatAgent
ImportError: attempted relative import with no known parent package

any help would be good.

joshfryart avatar Apr 16 '23 17:04 joshfryart

Hi @joshfryart ! Please install the package with pip install -e .. It is not supposed to be used from within the repository.

Obs01ete avatar Apr 16 '23 18:04 Obs01ete

Also @joshfryart thank you for putting our project into the forlder "_useful". We appreciate it!

Obs01ete avatar Apr 16 '23 19:04 Obs01ete

I did run pip install -e . and it still has the same issue :/ hmmmmm

joshfryart avatar Apr 16 '23 22:04 joshfryart

Not sure if this is a path problem in Windows. We will look into it. Thanks for reporting it @joshfryart

lightaime avatar Apr 17 '23 01:04 lightaime

Similar here (Mac),

Successfully built camel

Successfully installed camel-0.0.1

(camel) moses@MosesMoses ~/imaginativereasoning/camel/camel/agents (drafting)$ python role_playing.py
Traceback (most recent call last): File "/Users/moses/imaginativereasoning/camel/camel/agents/role_playing.py", line 7, in from .chat_agent import ChatAgent ImportError: attempted relative import with no known parent package

I went for https://iq-inc.com/importerror-attempted-relative-import/ but it did not work out,

7Moses avatar Apr 17 '23 19:04 7Moses

Oh, I see the problem that you are having. You should run the role_playing.py under the example/ai_society folder. Sorry for the confusing naming of the files.

On Mon 17. Apr 2023 at 22:33, 7Moses @.***> wrote:

Similar here (Mac),

Successfully built camel

Successfully installed camel-0.0.1

(camel) @.*** ~/imaginativereasoning/camel/camel/agents (drafting)$ python role_playing.py Traceback (most recent call last): File "/Users/moses/imaginativereasoning/camel/camel/agents/role_playing.py", line 7, in from .chat_agent import ChatAgent ImportError: attempted relative import with no known parent package

I went for https://iq-inc.com/importerror-attempted-relative-import/ but it did not work out,

— Reply to this email directly, view it on GitHub https://github.com/lightaime/camel/issues/91#issuecomment-1511969740, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFUJTYFDO7TR32K2SNPFS6LXBWLHVANCNFSM6AAAAAAXAHO6GI . You are receiving this because you commented.Message ID: @.***>

lightaime avatar Apr 17 '23 19:04 lightaime

@joshfryart @7Moses let me if it works by run the script examples/ai_society/role_playing.py. Thanks again for reporting this.

lightaime avatar Apr 18 '23 02:04 lightaime

  File "C:\Users\joshu\Documents\_aipython\_useful\camel\examples\ai_society\role_playing.py", line 3, in <module>
    from camel.agents import RolePlaying
ModuleNotFoundError: No module named 'camel'

joshfryart avatar Apr 18 '23 09:04 joshfryart

@joshfryart please try:

  1. pip install -e .
  2. run the script examples/ai_society/role_playing.py

Obs01ete avatar Apr 18 '23 11:04 Obs01ete

Thank you for getting back to me, appreciated

(Just in case: I did not use conda, see below for my .pyenv set up, )

I ran $ python /examples/ai_society/role_playing.py like this

(camel) moses@MosesMoses ~/imaginativereasoning/camel/examples/ai_society (drafting)$ python /examples/ai_society/role_playing.py

Nope, No such file,

(camel) moses@MosesMoses ~/imaginativereasoning/camel/examples/ai_society (drafting)$ python /Users/moses/imaginativereasoning/camel/examples/ai_society/role_playing.py

Traceback (most recent call last):

File "/Users/moses/imaginativereasoning/camel/examples/ai_society/role_playing.py", line 49, in main() File "/Users/moses/imaginativereasoning/camel/examples/ai_society/role_playing.py", line 16, in main role_play_session = RolePlaying("Python Programmer", "Stock Trader", File "/Users/moses/imaginativereasoning/camel/camel/agents/role_playing.py", line 39, in init self.specified_task_prompt = task_specify_agent.specify_task( File "/Users/moses/imaginativereasoning/camel/camel/agents/task_agent.py", line 56, in specify_task specified_task_msgs, terminated, _ = self.step(task_msg) File "/Users/moses/.pyenv/versions/camel/lib/python3.10/site-packages/tenacity/init.py", line 289, in wrapped_f return self(f, *args, **kw) File "/Users/moses/.pyenv/versions/camel/lib/python3.10/site-packages/tenacity/init.py", line 379, in call do = self.iter(retry_state=retry_state) File "/Users/moses/.pyenv/versions/camel/lib/python3.10/site-packages/tenacity/init.py", line 326, in iter raise retry_exc from fut.exception() tenacity.RetryError: RetryError[<Future at 0x1178f3b50 state=finished raised AuthenticationError>]

(camel) moses@MosesMoses ~/imaginativereasoning/camel/examples/ai_society (drafting)$

Best to you,

7Moses avatar Apr 18 '23 13:04 7Moses

@joshfryart please try:

1. pip install -e .

2. run the script examples/ai_society/role_playing.py

this worked. Thanks for missing my oversight. Having fun now 👯

joshfryart avatar Apr 18 '23 23:04 joshfryart

@joshfryart enjoy!

Obs01ete avatar Apr 19 '23 15:04 Obs01ete

I am curious why it doesn't work when I followed Install CAMEL from source with poetry (Recommended):? I can see camel exist in python3 console, but not able to run python3 examples/ai_society/role_playing.py which gave me no module named camel

luqiang21 avatar Jun 14 '24 18:06 luqiang21