GithubHelp home page GithubHelp logo

Comments (9)

tankywoo avatar tankywoo commented on June 4, 2024

http://simiki.org/zh-docs/usage.html#_2

你是不是没有额外装 fabric ?

from simiki.

ghostlyman avatar ghostlyman commented on June 4, 2024

新建一个新的问题依旧

(env3.6.3_simiki) xhxu-mac:simiki xhxu$ simiki init
/Users/xhxu/.pyenv/versions/3.6.3/lib/python3.6/subprocess.py:766: ResourceWarning: subprocess 10098 is still running
  ResourceWarning, source=self)
/Users/xhxu/.pyenv/versions/3.6.3/envs/env3.6.3_simiki/lib/python3.6/site-packages/tzlocal/darwin.py:8: ResourceWarning: unclosed file <_io.TextIOWrapper name=3 encoding='UTF-8'>
  tzname = os.popen("systemsetup -gettimezone").read().replace("Time Zone: ", "").strip()
[INFO]: Creating directory: /Users/xhxu/simiki/content
[INFO]: Creating directory: /Users/xhxu/simiki/output
[INFO]: Creating directory: /Users/xhxu/simiki/themes
[INFO]: Creating file: /Users/xhxu/simiki/_config.yml
[INFO]: Creating file: /Users/xhxu/simiki/fabfile.py
[INFO]: Creating directory: /Users/xhxu/simiki/content/intro
[INFO]: Creating file: /Users/xhxu/simiki/content/intro/gettingstarted.md
[INFO]: Copying default theme 'simple2' to: /Users/xhxu/simiki/themes
Create Dockerfile? (y/N)
[INFO]: Done.
(env3.6.3_simiki) xhxu-mac:simiki xhxu$ ls
_config.yml	content		fabfile.py	output		themes
(env3.6.3_simiki) xhxu-mac:simiki xhxu$
(env3.6.3_simiki) xhxu-mac:simiki xhxu$ fab
.python-version  _config.yml      content/         fabfile.py       output/          themes/
(env3.6.3_simiki) xhxu-mac:simiki xhxu$ fab
Traceback (most recent call last):
  File "/Users/xhxu/.pyenv/versions/env3.6.3_simiki/bin/fab", line 11, in <module>
    sys.exit(program.run())
  File "/Users/xhxu/.pyenv/versions/3.6.3/envs/env3.6.3_simiki/lib/python3.6/site-packages/invoke/program.py", line 321, in run
    self.parse_collection()
  File "/Users/xhxu/.pyenv/versions/3.6.3/envs/env3.6.3_simiki/lib/python3.6/site-packages/invoke/program.py", line 399, in parse_collection
    self.load_collection()
  File "/Users/xhxu/.pyenv/versions/3.6.3/envs/env3.6.3_simiki/lib/python3.6/site-packages/fabric/main.py", line 75, in load_collection
    super(Fab, self).load_collection()
  File "/Users/xhxu/.pyenv/versions/3.6.3/envs/env3.6.3_simiki/lib/python3.6/site-packages/invoke/program.py", line 588, in load_collection
    module, parent = loader.load(coll_name)
  File "/Users/xhxu/.pyenv/versions/3.6.3/envs/env3.6.3_simiki/lib/python3.6/site-packages/invoke/loader.py", line 75, in load
    module = imp.load_module(name, fd, path, desc)
  File "/Users/xhxu/.pyenv/versions/3.6.3/lib/python3.6/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/Users/xhxu/.pyenv/versions/3.6.3/lib/python3.6/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/xhxu/simiki/fabfile.py", line 9, in <module>
    from fabric.api import env, local, task, settings
ModuleNotFoundError: No module named 'fabric.api'

from simiki.

ghostlyman avatar ghostlyman commented on June 4, 2024

刚刚试了3.5.3,依旧不行

(env3.5.3_simiki) xhxu-mac:simiki xhxu$ fab
Can't find any collection named 'fabfile'!
(env3.5.3_simiki) xhxu-mac:simiki xhxu$ pip freeze
argh==0.26.2
asn1crypto==0.24.0
bcrypt==3.1.4
cffi==1.11.5
cryptography==2.2.2
docopt==0.6.1
fabric==2.1.3
ghp-import==0.5.5
idna==2.6
invoke==1.0.0
Jinja2==2.7.3
Markdown==2.6.8
MarkupSafe==1.0
ordereddict==1.1
paramiko==2.4.1
pathtools==0.1.2
pyasn1==0.4.3
pycparser==2.18
Pygments==1.6
PyNaCl==1.2.1
pytz==2015.7
PyYAML==3.11
simiki==1.6.2.1
six==1.11.0
tzlocal==1.2
watchdog==0.8.3
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(env3.5.3_simiki) xhxu-mac:simiki xhxu$ simiki init
/Users/xhxu/.pyenv/versions/3.5.3/envs/env3.5.3_simiki/lib/python3.5/site-packages/tzlocal/darwin.py:8: ResourceWarning: unclosed file <_io.TextIOWrapper name=3 encoding='UTF-8'>
  tzname = os.popen("systemsetup -gettimezone").read().replace("Time Zone: ", "").strip()
[INFO]: Creating directory: /Users/xhxu/simiki/content
[INFO]: Creating directory: /Users/xhxu/simiki/output
[INFO]: Creating directory: /Users/xhxu/simiki/themes
[INFO]: Creating file: /Users/xhxu/simiki/_config.yml
[INFO]: Creating file: /Users/xhxu/simiki/fabfile.py
[INFO]: Creating directory: /Users/xhxu/simiki/content/intro
[INFO]: Creating file: /Users/xhxu/simiki/content/intro/gettingstarted.md
[INFO]: Copying default theme 'simple2' to: /Users/xhxu/simiki/themes
Create Dockerfile? (y/N)
[INFO]: Done.
(env3.5.3_simiki) xhxu-mac:simiki xhxu$ fab
Traceback (most recent call last):
  File "/Users/xhxu/.pyenv/versions/env3.5.3_simiki/bin/fab", line 11, in <module>
    sys.exit(program.run())
  File "/Users/xhxu/.pyenv/versions/3.5.3/envs/env3.5.3_simiki/lib/python3.5/site-packages/invoke/program.py", line 321, in run
    self.parse_collection()
  File "/Users/xhxu/.pyenv/versions/3.5.3/envs/env3.5.3_simiki/lib/python3.5/site-packages/invoke/program.py", line 399, in parse_collection
    self.load_collection()
  File "/Users/xhxu/.pyenv/versions/3.5.3/envs/env3.5.3_simiki/lib/python3.5/site-packages/fabric/main.py", line 75, in load_collection
    super(Fab, self).load_collection()
  File "/Users/xhxu/.pyenv/versions/3.5.3/envs/env3.5.3_simiki/lib/python3.5/site-packages/invoke/program.py", line 588, in load_collection
    module, parent = loader.load(coll_name)
  File "/Users/xhxu/.pyenv/versions/3.5.3/envs/env3.5.3_simiki/lib/python3.5/site-packages/invoke/loader.py", line 75, in load
    module = imp.load_module(name, fd, path, desc)
  File "/Users/xhxu/.pyenv/versions/3.5.3/lib/python3.5/imp.py", line 234, in load_module
    return load_source(name, filename, file)
  File "/Users/xhxu/.pyenv/versions/3.5.3/lib/python3.5/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 693, in _load
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 673, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/Users/xhxu/simiki/fabfile.py", line 9, in <module>
    from fabric.api import env, local, task, settings
ImportError: No module named 'fabric.api'

from simiki.

ghostlyman avatar ghostlyman commented on June 4, 2024

奇怪 2.7.13 的也不行,还是因为我用了pyenv?

(env2.7.13_simiki) xhxu-mac:simiki xhxu$ fab
Traceback (most recent call last):
  File "/Users/xhxu/.pyenv/versions/env2.7.13_simiki/bin/fab", line 11, in <module>
    sys.exit(program.run())
  File "/Users/xhxu/.pyenv/versions/2.7.13/envs/env2.7.13_simiki/lib/python2.7/site-packages/invoke/program.py", line 321, in run
    self.parse_collection()
  File "/Users/xhxu/.pyenv/versions/2.7.13/envs/env2.7.13_simiki/lib/python2.7/site-packages/invoke/program.py", line 399, in parse_collection
    self.load_collection()
  File "/Users/xhxu/.pyenv/versions/2.7.13/envs/env2.7.13_simiki/lib/python2.7/site-packages/fabric/main.py", line 75, in load_collection
    super(Fab, self).load_collection()
  File "/Users/xhxu/.pyenv/versions/2.7.13/envs/env2.7.13_simiki/lib/python2.7/site-packages/invoke/program.py", line 588, in load_collection
    module, parent = loader.load(coll_name)
  File "/Users/xhxu/.pyenv/versions/2.7.13/envs/env2.7.13_simiki/lib/python2.7/site-packages/invoke/loader.py", line 75, in load
    module = imp.load_module(name, fd, path, desc)
  File "/Users/xhxu/simiki/fabfile.py", line 9, in <module>
    from fabric.api import env, local, task, settings
ImportError: No module named api

from simiki.

tankywoo avatar tankywoo commented on June 4, 2024

我使用的 版本Fabric==1.10.2,我看现在是 2.x 了,且你装的也是 fabric==2.1.3,可以降级到 1.10.2 试试,新版本的 fabric 我还没有看过它的 API 变化。

from simiki.

ghostlyman avatar ghostlyman commented on June 4, 2024

又有别的模块问题

ImportError: cannot import name 'isMappingType'
(env3.6.3_simiki) xhxu-mac:simiki xhxu$

ImportError: cannot import name 'isMappingType'
(env3.5.3_simiki) xhxu-mac:simiki xhxu$

(env2.7.13_simiki) xhxu-mac:simiki xhxu$ fab
Traceback (most recent call last):
  File "/Users/xhxu/.pyenv/versions/env2.7.13_simiki/bin/fab", line 7, in <module>
    from fabric.main import main
  File "/Users/xhxu/.pyenv/versions/2.7.13/envs/env2.7.13_simiki/lib/python2.7/site-packages/fabric/main.py", line 19, in <module>
    from fabric import api, state, colors
  File "/Users/xhxu/.pyenv/versions/2.7.13/envs/env2.7.13_simiki/lib/python2.7/site-packages/fabric/api.py", line 11, in <module>
    from fabric.decorators import (hosts, roles, runs_once, with_settings, task,
  File "/Users/xhxu/.pyenv/versions/2.7.13/envs/env2.7.13_simiki/lib/python2.7/site-packages/fabric/decorators.py", line 9, in <module>
    from Crypto import Random
ImportError: No module named Crypto
(env2.7.13_simiki) xhxu-mac:simiki xhxu$

from simiki.

tankywoo avatar tankywoo commented on June 4, 2024
  1. isMappingType 这个问题, Fabric 1.x 不支持 py3.x 😢 ,忘了这茬了。

  2. Crypto 这个问题,针对 Fabric 1.x 的版本,需要升级下,参考 fabric/fabric#1460 (comment),因为 fabric 对 paramiko 的版本依赖限制没有做好,导致 pycrypto 这个库没有安装上,可以升级到 fabric==1.10.3

P.S 有点想弃疗 fabric了,这几年的 issues 中,关于它的问题还不少。

from simiki.

ghostlyman avatar ghostlyman commented on June 4, 2024

OK,我打算放弃用这个fabric了,搜了下网上类似这个问题太多了,就解决这模块问题花费太久时间了。
最后决定调用Travis-CI来完成每次最终页面部署。

谢谢及时解答。

from simiki.

mymusise avatar mymusise commented on June 4, 2024

同样的问题,which fab发现调用的系统环境下的/usr/local/bin/fab
最后我用虚拟环境里的fabric $VENV/bin/fab -f deploy/deploy deploy 解决了

应该是系统版本的是python2的版本,然而我实际开发的是python3.7的。

from simiki.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.