# ModuleNotFoundError for installed module

**URL:** <https://discuss.python.org/t/modulenotfounderror-for-installed-module/76030>\
**Category:** Python Help\
**Created:** [January 3, 2025, 1:28pm UTC](https://discuss.python.org/t/modulenotfounderror-for-installed-module/76030 "2025-01-03T13:28:49Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![urello](https://avatars.discourse-cdn.com/v4/letter/u/f04885/32.png) [@urello](https://discuss.python.org/u/urello)\
**Post date:** [January 3, 2025, 1:28pm UTC](https://discuss.python.org/t/modulenotfounderror-for-installed-module/76030/1 "2025-01-03T13:28:50Z")

</div>

Getting ModuleNotFoundError for recently installed module. There are a lot of similar topics in google, however tips from there (use _python3 -m pip_ instead of _pip_ or use virtual env) didn’t help me. I also tried both with root and non-root user. Error is always the same. My OS is Debian 12.8 (fresh installation, only single python binary) and python version is 3.11. Any help is appreciated.

---

<div class="post-metadata">

**Author:** ![barry-scott](https://avatars.discourse-cdn.com/v4/letter/b/e9c0ed/32.png) [@barry-scott](https://discuss.python.org/u/barry-scott)\
**Post date:** [January 3, 2025, 5:23pm UTC](https://discuss.python.org/t/modulenotfounderror-for-installed-module/76030/2 "2025-01-03T17:23:33Z")

</div>

Please show the commands run, pip and python, and the error you see.

---

<div class="post-metadata">

**Author:** ![AlSweigart](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/alsweigart/32/12237_2.png) [@AlSweigart](https://discuss.python.org/u/AlSweigart)\
**Post date:** [January 4, 2025, 1:44am UTC](https://discuss.python.org/t/modulenotfounderror-for-installed-module/76030/3 "2025-01-04T01:44:25Z")

</div>

What module did you install?

What command did you use to install it, exactly?

What is the import statement causing this error, exactly?

What is the output of `where python3` and `where pip3` in your Terminal?

---

<div class="post-metadata">

**Author:** ![urello](https://avatars.discourse-cdn.com/v4/letter/u/f04885/32.png) [@urello](https://discuss.python.org/u/urello)\
**Post date:** [January 4, 2025, 9:55am UTC](https://discuss.python.org/t/modulenotfounderror-for-installed-module/76030/4 "2025-01-04T09:55:53Z")

</div>

```python
term@taz:~$ python3 -m pip install --break-system-packages okx.Trade
Requirement already satisfied: okx.Trade in /usr/local/lib/python3.11/dist-packages (1.0.2)
Requirement already satisfied: candlelite in /usr/local/lib/python3.11/dist-packages (from okx.Trade) (1.0.17)
Requirement already satisfied: paux>=1.0.5 in /usr/local/lib/python3.11/dist-packages (from okx.Trade) (1.0.14)
Requirement already satisfied: okx>=1.0.7 in /usr/local/lib/python3.11/dist-packages (from okx.Trade) (2.1.1)
Requirement already satisfied: okx-candle>=1.0.5 in /usr/local/lib/python3.11/dist-packages (from okx.Trade) (2.0.1)
Requirement already satisfied: urllib3 in /usr/lib/python3/dist-packages (from okx>=1.0.7->okx.Trade) (1.26.12)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from okx>=1.0.7->okx.Trade) (2.28.1)
Requirement already satisfied: pandas in /usr/local/lib/python3.11/dist-packages (from okx>=1.0.7->okx.Trade) (2.2.3)
Requirement already satisfied: numpy in /usr/local/lib/python3.11/dist-packages (from okx>=1.0.7->okx.Trade) (2.2.1)
Requirement already satisfied: pendulum in /usr/local/lib/python3.11/dist-packages (from okx-candle>=1.0.5->okx.Trade) (3.0.0)
Requirement already satisfied: redis in /usr/local/lib/python3.11/dist-packages (from paux>=1.0.5->okx.Trade) (5.2.1)
Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.11/dist-packages (from pandas->okx>=1.0.7->okx.Trade) (2.9.0.post0)
Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.11/dist-packages (from pandas->okx>=1.0.7->okx.Trade) (2024.2)
Requirement already satisfied: tzdata>=2022.7 in /usr/local/lib/python3.11/dist-packages (from pandas->okx>=1.0.7->okx.Trade) (2024.2)
Requirement already satisfied: time-machine>=2.6.0 in /usr/local/lib/python3.11/dist-packages (from pendulum->okx-candle>=1.0.5->okx.Trade) (2.16.0)
Requirement already satisfied: async-timeout>=4.0.3 in /usr/local/lib/python3.11/dist-packages (from redis->paux>=1.0.5->okx.Trade) (5.0.1)
Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil>=2.8.2->pandas->okx>=1.0.7->okx.Trade) (1.16.0)
term@taz:~$ python3 -c 'import okx.Trade'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'okx.Trade'

```

---

<div class="post-metadata">

**Author:** ![urello](https://avatars.discourse-cdn.com/v4/letter/u/f04885/32.png) [@urello](https://discuss.python.org/u/urello)\
**Post date:** [January 4, 2025, 10:01am UTC](https://discuss.python.org/t/modulenotfounderror-for-installed-module/76030/5 "2025-01-04T10:01:32Z")

</div>

Module name **okx.Trade**  
Tried both _python3 -m pip install --break-system-packages okx.Trade_ and _pip install --break-system-packages okx.Trade_

```python
python3 -c 'import okx.Trade'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'okx.Trade'

```

```python
whereis python3
python3: /usr/bin/python3 /usr/lib/python3 /etc/python3 /usr/share/python3 /usr/share/man/man1/python3.1.gz

```

```python
whereis pip3
pip3: /usr/bin/pip3 /usr/share/man/man1/pip3.1.gz

```

---

<div class="post-metadata">

**Author:** ![barry-scott](https://avatars.discourse-cdn.com/v4/letter/b/e9c0ed/32.png) [@barry-scott](https://discuss.python.org/u/barry-scott)\
**Post date:** [January 4, 2025, 10:29am UTC](https://discuss.python.org/t/modulenotfounderror-for-installed-module/76030/7 "2025-01-04T10:29:25Z")

</div>

I expect that the spelling on the import is not the same as for the pip command. Have a look at the docs for the module to find out how it should be imported. You could also look in /usr/local/lib/python3.11/dist-packages to see how the modules spells its nsne.

---

<div class="post-metadata">

**Author:** ![urello](https://avatars.discourse-cdn.com/v4/letter/u/f04885/32.png) [@urello](https://discuss.python.org/u/urello)\
**Post date:** [January 4, 2025, 10:37am UTC](https://discuss.python.org/t/modulenotfounderror-for-installed-module/76030/8 "2025-01-04T10:37:05Z")

</div>

I’m following API documentation `https://www.okx.com/docs-v5/en/?python#order-book-trading-trade-post-place-order` and it says to import that way.

```python
term@taz:~$ ls -l /usr/local/lib/python3.11/dist-packages |grep okx
drwxr-xr-x 5 term root 4096 Jan 3 14:47 okx
drwxr-xr-x 2 term root 4096 Jan 3 14:47 okx-2.1.1.dist-info
drwxr-xr-x 7 term root 4096 Jan 3 14:48 okx_candle
drwxr-xr-x 2 term root 4096 Jan 3 14:48 okx_candle-2.0.1.dist-info
drwxr-xr-x 7 term root 4096 Jan 3 14:48 okx_trade
drwxr-xr-x 2 term root 4096 Jan 3 14:48 okx_trade-1.0.2.dist-info

```

---

<div class="post-metadata">

**Author:** ![barry-scott](https://avatars.discourse-cdn.com/v4/letter/b/e9c0ed/32.png) [@barry-scott](https://discuss.python.org/u/barry-scott)\
**Post date:** [January 4, 2025, 10:53am UTC](https://discuss.python.org/t/modulenotfounderror-for-installed-module/76030/9 "2025-01-04T10:53:19Z")

</div>

The docs do not match the installed files…

Try `import okx_trade`.

---

<div class="post-metadata">

**Author:** ![BrenBarn](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@BrenBarn](https://discuss.python.org/u/BrenBarn)\
**Post date:** [January 5, 2025, 1:48am UTC](https://discuss.python.org/t/modulenotfounderror-for-installed-module/76030/10 "2025-01-05T01:48:24Z")

</div>

I suspect you haven’t installed the package you intended to install. The documentation you linked to is apparently for the package listed on pypi as `python-okx`, found [here](https://pypi.org/project/python-okx/). I think you installed the package listed on PyPI as `okx-trade`, found [here](https://pypi.org/project/okx-trade/).

Try uninstalling your `okx-trade` and instead install `python-okx`.
