1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Recursion】Pythonのモジュールが動かない理由はOSにあった

Posted at

はじめに

この記事では、Pythonモジュールが動かない理由を書いたものになります。私は現在WindowsのPCで学習を進めています。

実行環境

PC : Windows11
Python3 : 3.12.3

実際に起きた問題&エラー内容

VSCodeでPythonファイルを作成し、下記のコードを入力したら・・・

import os
os.mkfifo("test_pipe")

下記のような、エラーが出てしまいました。。。

<module>
    os.mkfifo(config['filepath'],0o600)
FileNotFoundError: [Errno 2] No such file or directory

ググってわかったこと

・どうやらos.mkfifo()はWindowsでは動かないらしい。。(macOS/Linux)で使える。

・WindowsのFIFO(名前付きパイプ)は、win32pipe.CreateNamedPipeなどのWin32APIを使う必要がある。

学んだこと

・ PythonのモジュールでもOS依存があることを知りました。

・ 開発するならmacのほうがいいかもしれないと思いました。

おわりに

こういったOS依存するものがこれから学習を進めていく中で、たくさん出てくるとは思いますが、しっかり調べ理解しながら解決していきたいです!

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?