私のフラスコのアプリにrequests
モジュールを使用する際に問題があります。私は同じディレクトリレベルでrest_server.py
とindependent.py
という2つのファイルを持っています。 independent.py
はrequests
モジュールを使用し、直接実行すると正しく実行されます。私はそれが次のエラー `Pythonフラスコ:モジュールのリクエストがありません
import independent
File "/home/satwik/Desktop/angelhack/independent.py", line 5, in <module>
import requests
ImportError: No module named requests`
を示しrest_server.py
でindependent.py
をインポートするときしかし、私はpip install requests
を試したのだが、要件がすでに満足を示しています。またrequests
をrest_server.py
にインポートしようとしましたが、正しく実行されています。 は、ここに私のコードです
** independent.py **
`import json
import os
import sys
import requests
sys.path.append('/home/satwik/Desktop/angelhack/comprehensive_search')
** rest_server.py **
`#!flask/bin/python
import six
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask.ext.httpauth import HTTPBasicAuth
import independent
app = Flask(__name__, static_url_path="")`
どのように私はこの問題を解決する必要がありますか?あなたは「何のモジュールという名前のない...」エラーが出るのはなぜ