Python导入运行的当前模块报错
引言
今天遇到了一个奇怪的现象,简单举个栗子:
文件结构如下:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVsAAABrCAMAAADuHNHGAAAC9FBMVEU8P0ENKT6Hk5p+jplAlsHsuwatra27u7vRZ1qap7A8P0Oenp88P0s/QERYP0FUP0E8P0dOP0F+iI9FSkxJP0ENKT9dY2fJZ1rLZ1oyKT62u7u6YVcoKT7IZVY9S1NNSzuojB28Z1pBREYNKUKztKvPZ1q/Z1nRZ1XFZFVER0kNKUalUESDP0E/P0FNKT5AjbQ/ia4/gaE/fp4+dpI/VGS2Z1q/YlazX1ZNUVTRYkY8P0U9P0G/nBXHoRLOphCqu7twuLuoqKmopqZud3zDZleNXle9YFa5XlZ5WlVeVVQ8P1E9SE64YULRU0FqP0FbP0FCKT6mq66Roqysq6qGkZl5g4l1foVmbnNNZ1p8ZlpgZFpUYVqnZ1k8RVZQVlU8P1QQO1LRZ1C9W1DRZ0o8Qkq4X0acTUJvP0LRR0F3QEFyP0G1QkBmKj6Yu7tOurs/krubu7qxu7A/hadwlqVNh6WvsqI8Q6Jehp+am5s+eJWBjJM+dI88SW48P2VeYWRYXmN3iF5/aVxaZ1s6U1o9TlqmpFm2XVVrVlUoTVV2gVSdaFQNKVNKT1KSd1Cmpkx/g0sWMkWwW0S4SkKwXUGLQEF8P0FjP0FQP0GsQEAkKT4VKT6OiDxYUjiXijSkiB6vkRu3lhi6mBfpugg8YbOap6+tuau7u55tgJGOj4+7u459foC7u248Qm1UW15yZ1p3ZlpJX1o8P1mtZ1ioYVieX1cUQ1bDYFXJZ093Uk+0WU6LV048QkuoZkoNM0rRWUY8P0a7TEO7fkG7V0HLTEGhP0FDP0EuKz5uKT5RrLtQqLtHpLs9gruWu7o8QbWDoLK7u69/p6ucu6d4k6Wuo5c8QZOpnZGtm4y1u4WAioBecH88VXprdHmikXg8VHe7r1uYZ1o3ZVpPW1pCWFo8QloNKlmcglWDWlUpSlOvZ1JeS1K7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k/Xc+vtfZZK0FXjbesxszNP036W28RKEbJtx2JMKaBu2yL8sWLyAcaKtsdYB3nVaxkOM3flqTNCCBepF29wtmHHLVOnB7k4J3MWkVYTj6LnlbaOwKIwTbfm3bJNp67Th60vkeTWVPU7im6mvaDsk/diMabNKj4087L3m0opFNI6f2ygSBmjrcmgbLhBzFNoK+P+tI9D2H0IAABD+4F6kLbgXGb7Fj4S2ahBp0VZNsrbVo5Mc3wCX3IssmaZEGSq9wWRqRIZHJtOmSWKDyJCuVJJkmWh1c6La9QmcuheZMDoZ1n2g3bUyr63vQx5igzPox1GDVBNqexPV3E/gxL1IkbKuPgnXfHfxoDeTrW35o1oTQ63GMROUJ3DmXqRoW4/MMmxJ39TStrzUlvqXHeBN4Ny9yFSZKe+6TPxtkCVmDKJ+H8XGtlgG/R5qwJcxN6+aQuDcvcg6yRryb1myYkEH/fKYkmyNJW24Fytn0A+WvmVENevhHqSL70Ua9HFJWFOWwIl7kXa03V6sHIGL7kXK2xZPj1vnuBcJAAAAEL5hFhkaZpHhHWaRIWEW+a+QzyIxflRxFonxo2qzSIwfSbVZJMaPpN4sEuNH9WaRGD+qN4vE+JFcP4vE+FFQZRaJ8aOgwiwS40cZzCIBAAAAICL4AQETWVVMdzuaAAAAAElFTkSuQmCC" alt="" />
其中tt.py
文件中定义了一个方法:
def tt():
print('tt')
我现在要在test.py
中使用tt()
, 代码如下:
from test.tt import tt
if __name__ == '__main__':
tt()
以上导入模块是编译器自动导入的,运行后直接报错:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAmkAAABmCAMAAACnZvYcAAAC+lBMVEUrKysoe97/a2grKzMrKzwqdN4odGcpMisrMqIoed0oetr/a1n/YDMrKzEoe9f4a2dxLCsrKzYrK14oUksrKy1SSmX1SjY1Ky4wKyxoKyv/a2b9amcoa5gsKys4VmgrLD9CLCvxYFMrbd4rK0X3a2jCa2jsaWgobkS7u7soe7PNa2j7amT9aF80KyvRa2g8TVsqU9fGYmRIYWjgZ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aN2f8Gsx1fONTO0v6qbZUcYQuZtbX7/N2FKdtFTeYMYrZwT5470F+2cBM+pUBE8GgrnhyFrVlb+3cg5POZDOU7zJ8paits/Wk7uTvsxkVB1scrW/t3XbWZ9WC/bnYuZHn8YDvpKO2uXUSWx7yt4YeYGS/R9LwdyPL4obZRc6kLuiWyPH6wLZmYdsVKIcsjavsLtv/Ddcs+xPzmnnyVz3vytx9i/g9/b/+vZ6l/lv/LNtAPBKP7ECEC8YiwDSRsuUDYBhK2XCBsAwlbLhC2gYQtFwjbQPza/l//3wpbfhG2/CJs+UXY8ouw5Rdhyy/Cll+ELb/8V7ZfAG5qlD1pmtLWAAAAAElFTkSuQmCC" alt="" />
可以看到编译器是有报错提示的,但是运行完全没有问题。
将路径换成相对路径试试呢?
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAANIAAABbCAMAAAAx+CtgAAAC91BMVEUrKysxMzU7OTQ8Pj9RVlhLS0upt8ZDnrjMeDJqh1lVVVWHkpqHkZdAlsFmbnJaXl7RZ1lER0hDQj47OUMzLC3suwbsuwVWXF88PkWLt8Wds8W2trbahXu+ZVqndzEuLCvKZlpITE5ISEBaPj9KOTNYLCvJyck+dI/Pg3NpVljJeDFIUDErKzDFUSs6LCs/iKxaYGRZX2LEZVpARERpPC9eKytMssg1d6XThXs7Rm5bYWRVWlw8QVQrKz5APzu/aS/Mayyoihmpt8Rmjax3gII7OWRhZFpdhVg5SE9MPEBbOTRLRC9QLitIKytWvsk4h8gzZcU/j7ebt7W+wLEzNZ9/iY/EhXrDenOVZFuIYlrRXFhcV1hqh1U+T1I1OVIrK096gEyJPj/JgzRwOTTEdzJAazKNaDGDNjGrWyy5lhS+mhPHoBDOpQ6Qt8aotr6Kp728yburuLh6m7NAZK2nrqw5SqrCxqapt6Y/gaI+f50/fJqgno5+g3toaW3XhWB/ZVq1ZFpRXFqoXViRWFh3VlhhVliafEk8RkeoXUTYTj9vPj+pmDp3ZTZxUDVnOTS7djJkXDJTQjFYU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LkcOiMzi5C/y+iXUHCrxposXlSIMjprZIZQgSgJZc7uESnkLRk30N5Qap8rcEpWKbklS5ToxByrFSlTZTclE4SmMX1KCc+8DKsGJ12qQt5TgiBvhhIjxU6X/8w2RdTGg5PgOQkz/JOL8jl//SXuXLIs3lCZuhsu4KMRHMKyk/UC/aolCcF1aojDxDbygVGwg78bXI76BYSXtV5jSXObpUhuJb+CFXWpcWK2/tsQ38IKSIyrvEuUgvoG9S+5K/8yz9PUrTP/KifftV5j+mf9L/+C7B9/GVrICtpIVsJWsgK1kBWwlK2ArWQFbyQrYShbgM+pEejJ4eWZ3AAAAAElFTkSuQmCC" alt="" />
很好,编译器是认识的,但是不好意思运行报错
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAnwAAABOCAMAAACNHjvrAAAC+lBMVEUrKyv/a2goe94yMjI8P0H+amj4a2crKzMrKz4qKysrKzEpMiv/YDMoet1SSmX1SjYrKzUodGcrKztyLCtmKysqdN4rMqIqLCv/a2T/a1g+Ky4rKy3Aa2fNa2jzamcsKyu7u7v9aF9tLCvtaWg0Kysoe9cobJkqU9Ypa9ArK17xYFItKy80Ky4xKyvsXlAoUkz/WUTfZ2etRTH7amP/a1toKysoe7MrLWMob0NaMi0oetr6amgrK0YtLjZBKysrbd7Ra2jGYmSBUmD/Zz4wMTkoQStGYGg4V2g8TVs2Ky6RWF8sPEuUMixTLyxCLSs3VWhKRWCJVV36ZVssP1T4TzvtTDs5Kysod9soe9rGa2gyT2b6amXVZGWOXGX/a2EoVll1T1dSSlTHSDSfOi8rYN4qPpKqa2hIYWitXmOqXmIrK1w0RlYzMjvFSTCWNy/7Ti0qYsBbr7soe7u5a2hYSV/4Y1b/a1EqLU//akrCSTUqNC+MNyuGKysoetMoesssWLQrTqfkaWgoU1DlXE8pS0ORPDH/XTCqNCxYKyspcdcqXMcodsAqWbwoc7crQbfYa2jaZmboamTRamShX2StX2OVWmJUUFz2Z1pLQVorM1SfMkyuM0coa0DZUDnXUDcvLC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SCmpZs5mTTB6mQK4SBDE69PAzIio9xOtGQCrLbVPVJes7mYuvKp91T8Pwa0Js5Ler/0ro1CYf4Vsf/U6Cw+96JSTjEV/0ZpkBh970Tk1hcY0GgMIT4Al6E+ALlIMQX8CLEFygHIb6AFyG+QDkI8QW8CPEFykGIL+BFiC9QDkJ8AS9CfIFyEOILeBHiCxSDEyJdeBxwfoJrAAAAAElFTkSuQmCC" alt="" />
那么问题来了,问什么编译器的自动导包会出现问题呢?这编译器也太不智能了。
探究
众所周知,Python模块导入的查找路径可以通过sys.path
查看,我看了一下:
['/home/hujing/workspace/python/python_demo/test', '/home/hujing/workspace/python/python_demo', '/usr/share/pycharm/helpers/pycharm_display', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', '/home/hujing/.local/lib/python3.5/site-packages', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages', '/usr/share/pycharm/helpers/pycharm_matplotlib_backend']
在第一个路径下找tt
可以找到,这也是上面正确运行的,没有问题
在第二个路径下找test.tt
,应该也可以找到啊,为什么会提示找不到呢?
相对路径查找为什么也找不到呢?在网上找了找,没有找到能够解决我问题的答案,那我就只好自己探究了。
尝试
首先,无法导入本包下的其他模块,尝试在其他模块中导入:
新建模块并导入刚才的test模块, 文件结构如下:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAARIAAACpCAMAAADQk0ITAAAC91BMVEU8P0ENKT6Hk5p+jpmtra27u7tAlsHsuwY8P0bRZ1o8P0xXP0Genp/LZ1pOP0FFSkx+iI+ap7BdY2dUP0E8P0lCQkRIP0G/YVY9P0HouQa6YVZlQEFtP0FRP0HEZljIZVc9SlG4X0W2u7uZu7txP0ENKUG9Z1paZ1rIohE7lME/gKCoZlmxXlU8P1JCREeDQEFAP0EyKT5NSzt7ZlrRZ1dKP0GqqqnFZFXRZ1I8REu1PkGpjRs8P2nQZ1o+T1d5W1VPVVV8P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yAUVASGdWBYB4IgCIIgiM+D09E4HY1hHRjWARjW8TsY1uEAhnU4A8M6HMCwDjkY1iEHwzocwLAORzCswwEM63ABTkcjCIIgiI+C7WhsR3vdjpajV0tPOm4kVOIET5WIAR30wnVih8PsWuLAkqUlsRy2UIYAMaCDXQJLL4PM+4UCd9DpYAG7kqrxpLEcdiVi9IJw6bgvd3O6UscuSQ+SWA4XSnQz5sbkVom4S4YN22xV4g/SWA4xukOmxC+45D1ulYjEqRTHpkQSy2GL7ggQAzrYBbb371bWxFb8Yd0lTAnYlUhiOWzRHQFiQAe75C4LsLUZXXH5eLUShwEIKkElikAlCMIgiAxUgkpQyd9VUp9EZhDe8VxJ/cioRAI1gkokUCOoxAkSJRcyEgmswAeeKoks8KYpaUoEquTq0pf02dWly3IStCdhl6rfhQIhQeGBacMWk1QPCOlemvgkipScmTfWsn4eEYiRkQRVXkEiZjxiv3pToUAJ0mcnfUp+vVyWkEv5iU+iRMnGbWNPWCwTCYMZ6J4lLeVBRJ6qiVrZldDLjvvUVkRiH72TFCg5M2/i2LHrLROf/CDEqiScWGlaJeybVAl515JuFN9EgZJr6y2Mt+bUrFDyIQkKvkt1HIigEi5+Fgp7W1lvnEckYm7nL8Q3UaCkqcXS+sPHx2azmRWuhtHH684wY68D3YNLpS3XihUiZq8I0ndlj1dCLoUfIL6Jkl1ywkJ9UAoQ1wTpWxGBHS2Jj6JAyet5E5+YBw0YMOAgcYVdSZ/ZK4iPougTh+Qwm3MMIK6xKcljXE58FSBKODjQTPcI52C/BJW4BxAEQTwEp6Nl4HS0AhQaQSVyI6jE3XR0ZgOnQ89eh3WwgWeOjyn0KqwjhoHnYwqVhnWISng+plBxWIeohONjCr0J62ADzxwfU+hNWAcbeOb4mELFYR38H1OoOKyD/2MKFYZ1qOeYQgzrQBAEQRDk3/ITvBsTXxU27jgAAAAASUVORK5CYII=" alt="" />
其中fun_test.py
文件只有一句:import test.test
先尝试一下刚才运行的模式:
aaarticlea/png;base64,iVBORw0KGgo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nSBa7KGuMi9EXM11DgxLCxsJCeoMorvH7gDO+/zMBfGiww1GEIvsQFsbrA1mnSJCzMHTDAaJ4QB4HbvLly+K0EWgIHhhvGBnl8AjpxoZPpWGEsEEax3UyRIJC6P8OemtCWhuMIKkcaWlEncS1oiUSV5bCRuPLm/mskIdxJ3K8Fyx54n/pRUVMHnirDPwp8rl8vjy5URiZcLwfHjylBQ2fJg3jOEd4u8rSrCL0VOHTnH/EwUqqCCW9FHysY1Owbb4eb0yWQonGf5V1ymC2QnLngfJQ5XyNiyNfxyXHZS5rRfmHb0kbIKGZufJmKbUycTZO/S3KpoX6Qi4Y1+fTr4cYFLHylD7ajm6GRCHcw0F+/zVsd/yeDHRS76wAK3w80xV7D3riO3SDXC2y0uakc3Z7jVhc09BO/B1mxuifJMweZS9y7VnOEWOU/EdRb+XDmK21w8tVZlc0uVTMUUdjM6w4Uzc1WqOcP92Yz7LEJ+icxIpCtMb+6+YeG2zCZgbobiGYoym7tc1JbZBMwtViid3eZ279qfR8iDWRiRuB7hTt8Kd1PGEgILby73079RjWpw/7hGG0JY4eZW6Z2r1qBRPLjTDuBi6llCWOHmNvYd3XRgoMtc9rps8kVcPfMlIaw4H8wjavHo3UltYsf0LEJYcc71+86De6U6LrxTEcKKM+4IvzdjxNO7H4MaQ627XObefUEIK9zcgEcFXX0QsdZliXBmluOMcYXLXpcxz90HieS5K71VSe/MElfokbgS9z/n4gXgD9Fw0QIw4JlouDBNAwLFw4WvkP1HiYebJMk3v89i4iYZIRcNF01VfuK5d/GDSFT3rpheMyTuf8H9Da/jsQAgV8A/AAAAAElFTkSuQmCC" alt="" />
不出意外会报错,因为运行路径已经换到fun目录下了,果不其然
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAn0AAAB2CAMAAACK9dUVAAAC91BMVEUrKysoe97/a2g8P0G7u7sqKysyMjIpMisrKzw1KywrLDModGcrMqIqdN4xKysoetsrK14oe9crKzX+amgrKy9nKysoUktYLysrN4v6amcrK1P/XzN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ROk7ur/HoPsA3yxv3YqI0N+AXgQMkjDcSEEETywiihUaFO59kKJ4zU7HTmwmQRjUiaqRATwgQDy6HDC5G2EcI3oRAnj2hf4G9CJgkITxegFPLCIKeh8A9D5IUbxmp8GqlSAM6kTVyADej58YHvUTg/4G9CJg+KowTMAiR4mfjE8M9z6A4GzOADj7wTPryeEpnBhkYN6P32N45F6ENquKZqyA/gb0ImD4JmHgiUVEybo2c0JQuPcBBK05AwDvTrjCh3vongDqRNXIAN6PP5XskXsRmn16+HdDfwN6ETA4mXp/A2bwxCKi8FPJ7n0AQW/OAMCbso1ODtU9AdSJqpEBPPt9TIch8cyfBH/CnwT/FIwwRhgjjBHGC4wwAowwAowwAowwAowwAowwAowwAowwvwgfAfz/YRRz1FTVAAAAAElFTkSuQmCC" alt="" />
相对路径经过尝试也是正常的。
思考
那我就奇怪了,为什么换个模块运行就可以。就不能正常导入自己包的模块吗?还是说python没有把运行路径当做包?
我觉得应该是后者,Python不会将执行的文件路径作为一个包来处理,在我经过一些其他的尝试之后,暂时看到的确实是这样。故而也就无法通过导入包的形式来导入了。
这只是我经过尝试,暂时得出的粗浅结论,目前还没有找到相关内容的说明,若哪位了解,还望不吝赐教。
项目路径
再有一个问题,Pycharm中运行正常,但是使用cmd直接运行就会报错,很简单,输出sys.path
,可以看到两者的不同,Pycharm非常贴心的讲我们项目的运行根路径添加进去了,在命令行运行就需要手动添加了。当然,你也可以选择讲各种自己的包都放到系统路径下,或者直接在系统路径下添加项目路径。
Python导入运行的当前模块报错的更多相关文章
- 四、Python导入自己写的包报错:没有该包如何解决
场景:当你运行文件时,提示没有你想要导入的这个包,这是只需在你运行文件的开头添加俩行代码: import sys sys.path.apprnd('../') 原理:请看图解 另外解释下sys.pat ...
- python pip安装模块报错 "Can't connect to HTTPS URL because the SSL module is not available."
在升级python版本为3.6之后,pip安装模块报错. 报错信息如图: 原因是系统自带的openssl版本与python3的版本不匹配,所以这里只要升级openssl版本就可以解决问题. yum - ...
- python 安装模块报错 response.py", line 302, in _error_catcher
python 安装模块报错 Exception:Traceback (most recent call last): File "/usr/share/python-wheels/urlli ...
- 使用Selenium模块报错的解决办法 (FileNotFound,WebDriverException)
添加Chrome浏览器程序的目录到系统Path变量中: C:\Users\%USERNAME%\AppData\Local\Google\Chrome\Application ,使用pip3 inst ...
- python2 + selenium + eclipse 中,配置好runserver 127.0.0.1:9000,运行的时候,报错
python2 + selenium + eclipse 中,配置好runserver 127.0.0.1:9000,运行的时候,报错,如图: 原因: google发现是WSGI appl ...
- python中引入包的时候报错AttributeError: module 'sys' has no attribute 'setdefaultencoding'解决方法?
python中引入包的时候报错:import unittestimport smtplibimport timeimport osimport sysimp.reload(sys)sys.setdef ...
- 运行Java Web项目报错
运行Java Web项目报错 今天,我启动服务,发现项目报错,并且是在打开登录界面时报错. 具体错误如下: org.apache.catalina.core.Standard WrapperValue ...
- eclipse运行项目,tomcat报错:Exception in thread :http-bio-8080-exec-4
eclipse运行项目,tomcat报错:Exception in thread :http-bio-8080-exec-4 转自 https://www.cnblogs.com/yby-blogs/ ...
- ansible执行shell模块和command模块报错| FAILED | rc=127 >> /bin/sh: lsof: command not found和| rc=2 >> [Errno 2] No such file or directory
命令: ansible -i hosts_20 st -m shell -a 'service zabbix_agentd star' -K --become ansible -i hosts_2 ...
随机推荐
- 洛谷 题解 P2312 【解方程】
Problem P2312 [解方程] >>> record 用时: 1166ms 空间: 780KB(0.76MB) 代码长度: 2.95KB 提交记录: R9909587 > ...
- Python3 并发编程小练习
实现基于TCP协议套接字,服务端实现接收客户端的连接并发 # server.py import socket from threading import Thread server = socket. ...
- 【JS】332- 为什么我更喜欢对象而不是 switch 语句
昨天偷懒了,欢迎点击关注???这样我就多更大的动力日更了- 正文从这里开始~~~ 最近(或者不是最近,这完全取决于您什么时候阅读这边文章),我正在跟我的团队伙伴讨论如何去处理这种需要根据不同的值去处理 ...
- 【Vuejs】269- 提升90%加载速度——vuecli下的首屏性能优化
前言 之前用 ,所以接下来还会介绍一些它们在优化上的异同 分析 vuecli 2.x自带了分析工具只要运行 npm run build --report 如果是 vuecli 3的话,先安装插件 cn ...
- 如何用Pact进行微服务集成测试
原文链接 https://codefresh.io/docker-tutorial/how-to-test-microservice-integration-with-pact/ 挑战:微服务集成测试 ...
- 《Java基础知识》Java集合(Map)
Java集合主要由2大体系构成,分别是Collection体系和Map体系,其中Collection和Map分别是2大体系中的顶层接口. 今天主要讲:Map主要有二个子接口,分别为HashMap.Tr ...
- SpringCloud-使用路由网关统一访问接口(附代码下载)
场景 SpringCloud-使用熔断器仪表盘监控熔断: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/102673599 Spr ...
- HCTF_2018-Writeup【web题】
HCTF_2018-Writeup 赛题来自:BUUCTF By:Mirror王宇阳 WarmUp: 打开赛题的页面源码(F12) <!DOCTYPE html> <html lan ...
- System.out.println高并发下导致应用暂停
今天在进行序列号压测的时候,通过调用genSeqId方法来获取序列号,100并发,16台压测机器,发现无论怎么压测,调用量达到140w左右的时候,此方法的ops直接掉到了0,具体图示如下: 从上图可以 ...
- RabbitMQ 离线安装(带视频)
疯狂创客圈 Java 高并发[ 亿级流量聊天室实战]实战系列 [博客园总入口 ] 架构师成长+面试必备之 高并发基础书籍 [Netty Zookeeper Redis 高并发实战 ] 疯狂创客圈 高并 ...