![](/img/trans.png)
[英]Python setup.py: data_files can't copy 'directory': doesn't exist or not a regular file
[英]“Cannot access setup.py: No such file or directory” - can't run any .py files?
這個問題在我安裝pyswip時開始,需要運行setup.py文件。 使用命令“ python setup.py”,我收到以下消息: "python: can't open file 'setup.py': [Errno 2] No such file or directory."
我知道這個問題已經被問過很多次了,所以我已經嘗試了先前答案中的所有內容。 在腳本的最頂部包含#!/usr/bin/env python
或#!/usr/bin/env python-3.3.0
,然后嘗試“ chmod +x setup.py
”將得到以下信息: "chmod: cannot access
setup.py': No such file or directory"
。
嘗試從終端運行其他.py文件會得到相同的結果。
從IDLE在Python Shell中運行文件不會執行任何操作。
運行“ ls -d * /”命令顯示肯定存在相關的.py文件的Python-3.3.0 /目錄。
我是否真的缺少明顯的東西? (如果有幫助,我使用的是Elementary OS 0.2。)
當您運行python setup.py
,該命令要求setup.py
文件位於當前目錄中。
您可以使用cd
命令控制當前目錄。
所以:
cd /home/acacia/Python-3.3.0/PySwip/pyswip-0.2.3
python setup.py install
我對Elementary OS不了解,但是您可以嘗試使用setup.py的完整路徑。
python /home/acacia/Python-3.3.0/PySwip/pyswip-0.2.3/setup.py install
[EDIT]無法回答評論,所以我在回答中添加了install參數
您需要進入要“設置”的目錄。 例如,如果您正在安裝numpy,並且已對其進行git-cloned,則它可能位於〜/ numpy。 因此,首先將CD插入〜/ numpy,然后在其中鍵入類似“ python setup.py build”的命令。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.