GVKun编程网logo

在Windows上的CygWin下调用python挂起(python调用windows程序)

12

如果您想了解在Windows上的CygWin下调用python挂起的相关知识,那么本文是一篇不可错过的文章,我们将对python调用windows程序进行全面详尽的解释,并且为您提供关于autorec

如果您想了解在Windows上的CygWin下调用python挂起的相关知识,那么本文是一篇不可错过的文章,我们将对python调用windows程序进行全面详尽的解释,并且为您提供关于autoreconf:在Windows上的cygwin中找不到命令、Building openresty1.7.10.1 with luajit on windows using Cygwin, 在windows下用Cygwin下编译带Luajit的openresty、c – CLion IDE:在Windows上使用ssh作为环境工具链而不是MinGW / Cygwin、cygwin – 如何在windows上改善babun的zsh加载时间?的有价值的信息。

本文目录一览:

在Windows上的CygWin下调用python挂起(python调用windows程序)

在Windows上的CygWin下调用python挂起(python调用windows程序)

安装新的Windows系统后,我已经在默认位置(c:\cygwin
c:\Python27\python)安装了CygWin和64位Python(2.7.3),并将CygWin
bin和Python目录都添加到了我的路径中(在用户变量PATH中)。在正常的命令窗口中,Python可以完美启动,但是当我bash在CygWin环境中调用它时,它挂起了,从不提示输入提示。

以前,我已经在其他计算机上做到了这一点,但始终使用旧版本的Python(32位)和CygWin,以及在绝对非标准位置使用Python。其他人有这个问题吗,或者有人可以告诉我这可能是什么原因?

答案1

小编典典

问题在于,由于Cygwin终端(MinTTY)的行为方式,Python的Windows本机Windows版本没有意识到stdout是终端设备-
它认为它是管道,因此它以非交互模式运行交互模式,并且完全缓冲其输出,而不是行缓冲。

这是新的原因,可能是因为在您先前的Cygwin安装中,您没有MinTTY,并且使用的终端只是标准的Windows终端。

为了解决此问题,您需要从常规Windows终端(Cmd.exe)运行Python
,或者安装Cygwin版本的Python,而不是Python的本机Windows版本。Cygwin版本(可通过Cygwin的软件包安装setup.exe)可理解Cygwin终端,并在通过MinTTY运行时表现适当。

如果所需的特定版本的Python不能作为Cygwin软件包提供,那么您还可以下载Python的源代码,并在Cygwin下自行构建。如果还没有Cygwin(GCC),则需要Cygwin编译器工具链,但是我认为它应该使用标准./configure&& make && make install命令进行编译。

autoreconf:在Windows上的cygwin中找不到命令

autoreconf:在Windows上的cygwin中找不到命令

我正在尝试在 windows中使用cygwin编译nDPI库.当我尝试运行autogen.sh文件时,我收到以下错误

./autogen.sh: line 5: autoreconf: command not found

我一直在四处寻找在Windows上编译这个nDPI库,我需要在windows上编译它.有人可以请:

>帮我在windows上编译这个库,或者
>引导我到一个实际工作的链接,我可以按照他们的步骤编译这个库?

我是编译库的先驱,所以请耐心等待我并使用初学者语言.

编辑:这是autogen.sh

#!/bin/sh


/bin/rm -f configure config.h config.h.in src/lib/Makefile.in
autoreconf -ivf
./configure
尝试安装autoconf,automake和libtool.它位于Cygwin安装程序的Devel之下.

Building openresty1.7.10.1 with luajit on windows using Cygwin, 在windows下用Cygwin下编译带Luajit的openresty

Building openresty1.7.10.1 with luajit on windows using Cygwin, 在windows下用Cygwin下编译带Luajit的openresty

总结

以上是小编为你收集整理的Building openresty1.7.10.1 with luajit on windows using Cygwin, 在windows下用Cygwin下编译带Luajit的openresty全部内容。

如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。

c – CLion IDE:在Windows上使用ssh作为环境工具链而不是MinGW / Cygwin

c – CLion IDE:在Windows上使用ssh作为环境工具链而不是MinGW / Cygwin

我目前正在使用CLion 2016.2,我会在Windows上使用ssh作为环境工具链而不是MinGW / Cygwin.例如,Pycharm已经支持环境using a ssh location(或使用docker容器)的远程位置,并且它运行良好.我想知道这个功能是否可以用于CLion或者更高版本?

到目前为止,我发现尝试在Windows或Linux上配置CLion工具链时存在差异:


(Windows Clion工具链设置)


(Ubuntu Clion工具链设置)

然而,我没有看到任何关于远程位置的信息,例如ssh或docker来配置环境,这对Windows特别有用.

最佳答案

使用CLion2018.3或更高版本,您可以执行以下操作:

看到:

https://www.jetbrains.com/clion/whatsnew/
https://www.jetbrains.com/help/clion/remote-projects-support.html

欲获得更多信息.

cygwin – 如何在windows上改善babun的zsh加载时间?

cygwin – 如何在windows上改善babun的zsh加载时间?

我喜欢ZSH shell及其主题,但它非常慢.加载需要7到10秒.我也将它用作VS Code中的集成终端,即使加载速度很慢.这是我的.zshrc文件的副本.

# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
export PS1="[%* - %D] %d %% "


# Set name of the theme to load. 
# Look in ~/.oh-my-zsh/themes/
# Optionally,if you set this to "random",it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="agnoster"
DEFAULT_USER=13000

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"

# Uncomment the following line to disable bi-weekly auto-update checks.
# disABLE_AUTO_UPDATE="true"

# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13

# Uncomment the following line to disable colors in ls.
# disABLE_LS_COLORS="true"

# Uncomment the following line to disable auto-setting terminal title.
# disABLE_AUTO_TITLE="true"

# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for 
  completion.
# COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to disable marking untracked 
  files
# under VCS as dirty. This makes repository status check for large 
  repositories
# much,much faster.
# disABLE_UNTRACKED_FILES_DIRTY="true"

# Uncomment the following line if you want to change the command execution 
  time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-
  zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely,as too many plugins slow down shell startup.
  plugins=(git)

# User configuration

export PATH=$HOME/bin:/usr/local/bin:$PATH
# export MANPATH="/usr/local/man:$MANPATH"

source $ZSH/oh-my-zsh.sh


# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"

# Set personal aliases,overriding those provided by oh-my-zsh libs,# plugins,and themes. Aliases can be placed here,though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases,run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

prompt_dir() {
  prompt_segment blue black "${PWD##*/}"
}

编辑::我在我的cygwin目录中找到了2个oh-my-zsh.sh文件,所以这两个都是.

第一

# Check for updates on initial load...
if [ "$disABLE_AUTO_UPDATE" != "true" ]; then
  env ZSH=$ZSH disABLE_UPDATE_PROMPT=$disABLE_UPDATE_PROMPT zsh -f 
$ZSH/tools/check_for_upgrade.sh
fi

# Initializes Oh My Zsh

# add a function path
fpath=($ZSH/functions $ZSH/completions $fpath)

# Load all stock functions (from $fpath files) called below.
autoload -U compaudit compinit

: ${ZSH_disABLE_COMPFIX:=true}

# Set ZSH_CUSTOM to the path where your custom config files
# and plugins exists,or else we will use the default custom/
if [[ -z "$ZSH_CUSTOM" ]]; then
    ZSH_CUSTOM="$ZSH/custom"
fi

# Set ZSH_CACHE_DIR to the path where cache files should be created
# or else we will use the default cache/
if [[ -z "$ZSH_CACHE_DIR" ]]; then
  ZSH_CACHE_DIR="$ZSH/cache"
fi


# Load all of the config files in ~/oh-my-zsh that end in .zsh
# TIP: Add files you don't want in git to .gitignore
for config_file ($ZSH/lib/*.zsh); do
  custom_config_file="${ZSH_CUSTOM}/lib/${config_file:t}"
  [ -f "${custom_config_file}" ] && config_file=${custom_config_file}
  source $config_file
done


is_plugin() {
  local base_dir=$1
  local name=$2
  test -f $base_dir/plugins/$name/$name.plugin.zsh \
    || test -f $base_dir/plugins/$name/_$name
}
# Add all defined plugins to fpath. This must be done
# before running compinit.
for plugin ($plugins); do
  if is_plugin $ZSH_CUSTOM $plugin; then
fpath=($ZSH_CUSTOM/plugins/$plugin $fpath)
  elif is_plugin $ZSH $plugin; then
    fpath=($ZSH/plugins/$plugin $fpath)
  fi
done

# figure out the SHORT hostname
if [[ "$OSTYPE" = darwin* ]]; then
  # macOS's $HOST changes with dhcp,etc. Use ComputerName if possible.
  SHORT_HOST=$(scutil --get ComputerName 2>/dev/null) || 
SHORT_HOST=${HOST/.*/}
else
  SHORT_HOST=${HOST/.*/}
fi

# Save the location of the current completion dump file.
if [ -z "$ZSH_COMPDUMP" ]; then
  ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
fi

if [[ $ZSH_disABLE_COMPFIX != true ]]; then
  # If completion insecurities exist,warn the user without enabling 
completions.
  if ! compaudit &>/dev/null; then
    # This function resides in the "lib/compfix.zsh" script sourced above.
    handle_completion_insecurities
  # Else,enable and cache completions to the desired file.
  else
    compinit -d "${ZSH_COMPDUMP}"
  fi
else
  compinit -i -d "${ZSH_COMPDUMP}"
fi

# Load all of the plugins that were defined in ~/.zshrc
for plugin ($plugins); do
  if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then
    source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh
  elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
    source $ZSH/plugins/$plugin/$plugin.plugin.zsh
  fi
done

# Load all of your custom configurations from custom/
for config_file ($ZSH_CUSTOM/*.zsh(N)); do
  source $config_file
done
unset config_file

# Load the theme
if [ "$ZSH_THEME" = "random" ]; then
  themes=($ZSH/themes/*zsh-theme)
  N=${#themes[@]}
  ((N=(RANDOM%N)+1))
  RANDOM_THEME=${themes[$N]}
  source "$RANDOM_THEME"
  echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
else
  if [ ! "$ZSH_THEME" = ""  ]; then
    if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]; then
      source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme"
    elif [ -f "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" ]; then
      source "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme"
    else
      source "$ZSH/themes/$ZSH_THEME.zsh-theme"
    fi
  fi
fi

第二个是

# Check for updates on initial load...
if [ "$disABLE_AUTO_UPDATE" != "true" ]; then
  env ZSH=$ZSH disABLE_UPDATE_PROMPT=$disABLE_UPDATE_PROMPT zsh -f 
$ZSH/tools/check_for_upgrade.sh
fi

# Initializes Oh My Zsh

# add a function path
fpath=($ZSH/functions $ZSH/completions $fpath)

# Set ZSH_CUSTOM to the path where your custom config files
# and plugins exists,or else we will use the default custom/
if [[ -z "$ZSH_CUSTOM" ]]; then
    ZSH_CUSTOM="$ZSH/custom"
fi

# Set ZSH_CACHE_DIR to the path where cache files should be created
# or else we will use the default cache/
if [[ -z "$ZSH_CACHE_DIR" ]]; then
  ZSH_CACHE_DIR="$ZSH/cache/"
fi


# Load all of the config files in ~/oh-my-zsh that end in .zsh
# TIP: Add files you don't want in git to .gitignore
for config_file ($ZSH/lib/*.zsh); do
  custom_config_file="${ZSH_CUSTOM}/lib/${config_file:t}"
  [ -f "${custom_config_file}" ] && config_file=${custom_config_file}
  source $config_file
done

# Load all of your custom configurations from custom/
for config_file ($ZSH_CUSTOM/*.zsh(N)); do
  source $config_file
done
unset config_file

is_plugin() {
  local base_dir=$1
  local name=$2
  test -f $base_dir/plugins/$name/$name.plugin.zsh \
    || test -f $base_dir/plugins/$name/_$name
}
# Add all defined plugins to fpath. This must be done
# before running compinit.
for plugin ($plugins); do
  if is_plugin $ZSH_CUSTOM $plugin; then
    fpath=($ZSH_CUSTOM/plugins/$plugin $fpath)
  elif is_plugin $ZSH $plugin; then
    fpath=($ZSH/plugins/$plugin $fpath)
  fi
done

# figure out the SHORT hostname
if [[ "$OSTYPE" = darwin* ]]; then
  # OS X's $HOST changes with dhcp,etc. Use ComputerName if possible.
  SHORT_HOST=$(scutil --get ComputerName 2>/dev/null) || 
SHORT_HOST=${HOST/.*/}
else
  SHORT_HOST=${HOST/.*/}
fi

# Save the location of the current completion dump file.
if [ -z "$ZSH_COMPDUMP" ]; then
  ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
fi

# Load and run compinit
autoload -U compinit
compinit -i -d "${ZSH_COMPDUMP}"

# Load all of the plugins that were defined in ~/.zshrc
for plugin ($plugins); do
  if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then
    source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh
  elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
    source $ZSH/plugins/$plugin/$plugin.plugin.zsh
  fi
done

# Load the theme
if [ "$ZSH_THEME" = "random" ]; then
  themes=($ZSH/themes/*zsh-theme)
  N=${#themes[@]}
  ((N=(RANDOM%N)+1))
  RANDOM_THEME=${themes[$N]}
  source "$RANDOM_THEME"
  echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
else
  if [ ! "$ZSH_THEME" = ""  ]; then
    if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]; then
      source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme"
    elif [ -f "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" ]; then
      source "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme"
    else
      source "$ZSH/themes/$ZSH_THEME.zsh-theme"
    fi
  fi
fi

不要介意长篇帖子:D.

解决方法

我在我的Windows 10机器上安装了babun.

禁用bash自动完成作业会略微改善我的加载时间.我将所有文件重命名为“bash_completion.d”目录中的“.bk”扩展名.

{ ~ }  » ls -ltr /etc/bash_completion.d                                                         ~
total 68
-rwxrwx---+ 1 m.ortiz.montealegre Domain Users   998 Jun 23  2015 vim-completion.bk
-rwxrwx---+ 1 m.ortiz.montealegre Domain Users 44924 Jun 23  2015 svn.bk
-rwxrwx---+ 1 m.ortiz.montealegre Domain Users  1200 Jun 23  2015 gvim-completion.bk
-rwxrwx---+ 1 m.ortiz.montealegre Domain Users  2609 Jun 23  2015 gsettings.bk
-rwxrwx---+ 1 m.ortiz.montealegre Domain Users  1356 Jun 23  2015 gresource.bk
-rwxrwx---+ 1 m.ortiz.montealegre Domain Users   935 Jun 23  2015 gdbus.bk
-rwxrwx---+ 1 m.ortiz.montealegre Domain Users  1389 Jun 23  2015 gapplication.bk

另外调试是一个很好的选择,有了strace来看看Cygwin加载时发生了什么,请查看这个question.

编辑:

关于Babun调整

你可以用来检查你的安装的工具记录在babun网站上,使用babun check也许这提供了一些线索:

{ ~ } » babun check                                                                          ~
Executing babun check
Prompt speed      [SLOW]
Hint: your prompt is very slow. Check the installed 'BLODA' software.
Connection check  [OK]
Update check      [OK]
Cygwin check      [OK]

我不知道你是否在你的babun安装中进行了一些调整,请检查你的〜/ .babunrc文件并确认你已经禁用了自动更新和启动检查(不要启用它们):

# JVM options
export JAVA_OPTS="-xms128m -Xmx256m"

# Modify these lines to set your locale
export LANG="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"

# Uncomment these lines to the set your machine's default locale (and comment out the UTF-8 ones)
# export LANG=$(locale -uU)
# export LC_CTYPE=$(locale -uU)
# export LC_ALL=$(locale -uU)

# Uncomment this to disable daily auto-update & proxy checks on startup (not recommended!)
# export disABLE_CHECK_ON_STARTUP="true"

# Uncomment to increase/decrease the check connection timeout
# export CHECK_TIMEOUT_IN_SECS=4

# Uncomment this lines to set up your proxy
# export http_proxy=http://user:password@server:port
# export https_proxy=$http_proxy
# export ftp_proxy=$http_proxy
# export no_proxy=localhost

关于Cygwin

如果您对Strace的调试不满意,可以为Cygwin探索一些调整here和here.

我认为你应该抽象出“babun”的东西,不要忘记嵌入的Cygwin,我认为你真正想要加速的是,babun核心是一个Cygwin实现,有一些变化:

The core of Babun consists of a pre-configured Cygwin.

我们今天的关于在Windows上的CygWin下调用python挂起python调用windows程序的分享已经告一段落,感谢您的关注,如果您想了解更多关于autoreconf:在Windows上的cygwin中找不到命令、Building openresty1.7.10.1 with luajit on windows using Cygwin, 在windows下用Cygwin下编译带Luajit的openresty、c – CLion IDE:在Windows上使用ssh作为环境工具链而不是MinGW / Cygwin、cygwin – 如何在windows上改善babun的zsh加载时间?的相关信息,请在本站查询。

本文标签: