langchain icon indicating copy to clipboard operation
langchain copied to clipboard

ModuleNotFoundError: No module named 'langchain.memory'

Open Daremitsu1 opened this issue 1 year ago • 5 comments

Issue you'd like to raise.

Hello,

While trying to import from langchain.memory import ConversationBufferMemory I am getting the error ``` ModuleNotFoundError: No module named 'langchain.memory' Traceback:

File "c:\users\aviparna.biswas\appdata\local\programs\python\python37\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)
File "D:\Python Projects\POC\Radium\Ana\app.py", line 8, in <module>
    from langchain.memory import ConversationBufferMemory

I have already installed langchain and it is showing in my packages.

Daremitsu1 avatar May 08 '23 08:05 Daremitsu1

It works for me.

PawelFaron avatar May 08 '23 08:05 PawelFaron

It works for me.

Is there a specific version of langchain you are using? I have updated it yet the problem is persisting.

Daremitsu1 avatar May 08 '23 10:05 Daremitsu1

for me also , it is working

langchain.version '0.0.154' . Python version is Python 3.9.12

pulkitmehtawork avatar May 09 '23 05:05 pulkitmehtawork

This seems to be python version problem. I was using version 3.7.9 where as I think langchain works on versions >= 3.8. Is the version specifications provided in any documentation. I couldn't find it.

Daremitsu1 avatar May 09 '23 13:05 Daremitsu1

I'm also having this same error. I'm running python 3.11 so it's not a version issue for me. Any idea what it could be?

PeakNova avatar Jul 11 '23 16:07 PeakNova

It's same to me ,python version 3.11.4

Logos111 avatar Jul 18 '23 02:07 Logos111

same thing for me and I'm running python version 3.10

ando1fe avatar Jul 18 '23 21:07 ando1fe

I comment bc I wanna know. I have the same issue u.u

pmalca avatar Jul 30 '23 23:07 pmalca

This was definitely an issue with Python versions. When I tried Python >= 3.10 I could successfully install LangChain, however I'd have missing modules like langchain.memory and langchain.embeddings. Once I downgraded my project to Python 3.9 however, everything started working as intended.

chand1012 avatar Aug 06 '23 15:08 chand1012

I am getting the same error even after downgrading my python version to 3.9,Is there any other solution?

dhanushchalicheemala avatar Nov 22 '23 17:11 dhanushchalicheemala