Comments (14)
This is the basic python path problem, which is depended on the evironment you use. When you use pycharm as your development IDE, it will set the project root directory into your python path list where the python program will search package at. In your case, when you clone the project into 机器人
directory, the python program will not find the src
module which is the problem you are facing.
So, there are some solutions:
- open the
python-wechaty-puppet-itchat-main
directory with pycharm, so it will find thesrc
module. - add the
机器人/python-wechaty-puppet-itchat-main
directory into yousys.path
.
Hope that can help you fix the problem.
from python-wechaty-puppet-itchat.
A ha ~~~, you can contribute changes in this pr, because we have some discussions in this issue which is related to that pr. How do you think about @lyleshaw ?
That's sounds great.
from python-wechaty-puppet-itchat.
from python-wechaty-puppet-itchat.
from python-wechaty-puppet-itchat.
the code can't import from the src.
please check it out
from python-wechaty-puppet-itchat.
@lyleshaw I think we shoule not rename itchat
, which is the source project name, to itchat_wechaty
. There are some problems that itchat
lies under src
directory.
- when you publish the
wechaty-puppet-itchat
package, it will packageitchat
andwechaty-puppet-itchat
modules into one package. So, when we install thewechaty-puppet-itchat
package, it will installitchat
andwechaty_puppet_itchat
modules into your site-packages. And what's more, it will existitchat
package before you install it, so it will get into conflict. itchat
shoule not be the external pacakge, because it has been heavily modified. In this situation, I suggest that we can movesrc/itchat
directory intosrc/wechaty_puppet_itchat/
directory. So it will be the sub module ofwechaty_puppet_itchat
.
we should not import wechaty_puppet_itchat
from src package, which is included in published pacakge. You can get publishing detail in setup.py
.
from python-wechaty-puppet-itchat.
@zepengliu for your prblem, I think you can set the python-wechaty-puppet-itchat-main
as the sources in your pycharm: Setting -> Project Structure -> Sources. Following this setting, the program will automaticly add it into your sys.path
.
This is the small trick and tool of pycharm. Hope that can help you fix this issue.
from python-wechaty-puppet-itchat.
@lyleshaw I think we shoule not rename
itchat
, which is the source project name, toitchat_wechaty
. There are some problems thatitchat
lies undersrc
directory.
- when you publish the
wechaty-puppet-itchat
package, it will packageitchat
andwechaty-puppet-itchat
modules into one package. So, when we install thewechaty-puppet-itchat
package, it will installitchat
andwechaty_puppet_itchat
modules into your site-packages. And what's more, it will existitchat
package before you install it, so it will get into conflict.itchat
shoule not be the external pacakge, because it has been heavily modified. In this situation, I suggest that we can movesrc/itchat
directory intosrc/wechaty_puppet_itchat/
directory. So it will be the sub module ofwechaty_puppet_itchat
.we should not import
wechaty_puppet_itchat
from src package, which is included in published pacakge. You can get publishing detail insetup.py
.
Got it, I'll close that PR.
from python-wechaty-puppet-itchat.
A ha ~~~, you can contribute changes in this pr, because we have some discussions in this issue which is related to that pr. How do you think about @lyleshaw ?
from python-wechaty-puppet-itchat.
first of all, through the method is success without the wrong to import src :Setting -> Project Structure -> Sources however,there is another wrong import .
同样的问题,ding可以收到,但是不回复dong。
from python-wechaty-puppet-itchat.
from python-wechaty-puppet-itchat.
sorry,it is my problem. i should update sqlalchemy from 1.3.22 to 1.4.25 , it is ok now. I recommend you should write the sqlalchemy version in the requirement.txt also.
Got it.
I'll update requirement.txt in the next PR.
Thanks for your suggestion~
from python-wechaty-puppet-itchat.
因为pycharm和vscode等IDE工具的文件目录机制不同,
为了对入门用户更加友好,建议添加本文件夹路径和src路径。
import sys,os
sys.path.append(os.getcwd()+"/src")
sys.path.append(os.getcwd())
from python-wechaty-puppet-itchat.
因为pycharm和vscode等IDE工具的文件目录机制不同, 为了对入门用户更加友好,建议添加本文件夹路径和src路径。
import sys,os sys.path.append(os.getcwd()+"/src") sys.path.append(os.getcwd())
Thanks for your solution for this problem. But this is the very simple python path issue for developer which should not be here.
What's more, If you use the python-wechaty-puppet-itchat
package, you will pip install wechaty-puppet-itchat
not
other than cloning the source code. So we should not add the src
dir to python path variable list.
How do you think about it ? @fangjiyuan
from python-wechaty-puppet-itchat.
Related Issues (16)
- 当我发送文字 [泽@Home 9]:没问题,发#ding 时,异常退出了。 HOT 2
- when i try to run bot.Contact.find,get some error. HOT 3
- Issue templates are meaningful HOT 2
- Use dependency of `itchat` instead of a source hard fork HOT 2
- itchat 都的功能都能用了吗 HOT 3
- wechaty-puppet-service: token not found. please set HOT 3
- Add a GitHub Action badge to README
- 【Feature 💁 💁】CICD is required for opensource project HOT 1
- 🐛🐛 Bug Report: 尝试搭建一个发送文字到指定微信用户的API,使用了itchat的search_friends方法,运行非常慢。 HOT 1
- 🐛🐛 Bug Report: 使用示例中的room-bot时,获取不到room,一直为空
- Fix the linting issue HOT 1
- KeyError: 'wxsid' HOT 3
- 为什么有的账户可以登陆,但有的账户不能登陆 HOT 1
- The scan event only occurs after the user scans HOT 2
- 【todo】Check_box for Features
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-wechaty-puppet-itchat.