Canopy的集成Ipython终端允许使用Emacs键绑定,但集成的代码编辑器不允许.从一个窗口切换到另一个窗口时这是一个问题...有没有办法在"Enthought"Canopy代码编辑器中激活Emacs键绑定?(我在OS X上)
我最近卸载了一个很好的Enthought Canopy 32位工作副本并安装了Canopy版本1.1.0(64位).当我尝试使用sklearn来适应模型我的内核崩溃时,我收到以下错误:
The kernel (user Python environment) has terminated with error code 3. This may be due to a bug in your code or in the kernel itself.
Output captured from the kernel process is shown below.
OMP: Error #15: Initializing libiomp5md.dll, but found mk2iomp5md.dll already initialized.
OMP: Hint: This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The …Run Code Online (Sandbox Code Playgroud) 提前抱歉,如果这是一个有点长的啰嗦,但如果我把它减少太多,问题就会丢失.我正在尝试在pandas和matplotlib之上创建一个模块,这将使我能够创建类似于scatter_matrix的配置文件图和配置文件矩阵.我很确定我的问题归结为我需要从Profile()返回什么对象,以便我可以处理Profile_Matrix()中的Axes操作.然后问题是什么返回形式Profile_Matrix()所以我可以编辑子图.
我的模块(ProfileModule.py)从https://github.com/pydata/pandas/blob/master/pandas/tools/plotting.py借了很多,看起来像:
import pandas as pd
from pandas import Series, DataFrame
import numpy as np
import matplotlib.pyplot as plt
def Profile(x,y,nbins,xmin,xmax):
df = DataFrame({'x' : x , 'y' : y})
binedges = xmin + ((xmax-xmin)/nbins) * np.arange(nbins+1)
df['bin'] = np.digitize(df['x'],binedges)
bincenters = xmin + ((xmax-xmin)/nbins)*np.arange(nbins) + ((xmax-xmin)/(2*nbins))
ProfileFrame = DataFrame({'bincenters' : bincenters, 'N' : df['bin'].value_counts(sort=False)},index=range(1,nbins+1))
bins = ProfileFrame.index.values
for bin in bins:
ProfileFrame.ix[bin,'ymean'] = df.ix[df['bin']==bin,'y'].mean()
ProfileFrame.ix[bin,'yStandDev'] = df.ix[df['bin']==bin,'y'].std()
ProfileFrame.ix[bin,'yMeanError'] = ProfileFrame.ix[bin,'yStandDev'] / np.sqrt(ProfileFrame.ix[bin,'N'])
fig = plt.figure();
ax = …Run Code Online (Sandbox Code Playgroud) 我正在尝试在我的Mac上安装Torch7,但此时安装暂停:
Not updating your shell profile.
You might want to
add the following lines to your shell profile:
export PATH=/Users/khsiddiqui/torch/install/bin:$PATH
export LD_LIBRARY_PATH=/Users/khsiddiqui/torch/install/lib:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=/Users/khsiddiqui/torch/install/lib:$DYLD_LIBRARY_PATH
Run Code Online (Sandbox Code Playgroud)
不确定这意味着什么.上面我收到了以下输出
echo "Error: could not find ipython in PATH. Do you have it installed?"
fi
Run Code Online (Sandbox Code Playgroud)
但是我安装了iPython,因为我可以确认:
No update necessary, 'ipython' is up-to-date.
ipython-3.0.0-3.egg was installed on: Thu Apr 9 18:12:32 2015
kamransiquisMBP:torch khsiddiqui$ env | grep PATH
PATH=/Users/khsiddiqui/Library/Enthought/Canopy_64bit/User/bin:
/usr/local/bin:
/usr/bin:
/bin:
/usr/sbin:
/sbin:
/opt/X11/bin:
/usr/texbin
Run Code Online (Sandbox Code Playgroud)
试图找到.bashrc文件
%edit .bashrc
WARNING: Argument given (.bashrc) can't be found as …Run Code Online (Sandbox Code Playgroud) 我正在开发一个应用程序,它需要使用pyserial模块将字节数组发送到串行端口.我已成功运行代码在canopy中执行此操作:
import serial
ser = serial.Serial('/dev/ttyACM0', 9600, serial.EIGHTBITS, serial.PARITY_NONE, serial.STOPBITS_ONE)
ser.write([4, 9, 62, 144, 56, 30, 147, 3, 210, 89, 111, 78, 184, 151, 17, 129])
Out[7]: 16
Run Code Online (Sandbox Code Playgroud)
但是当我在Spyder中运行相同的代码(两者都运行Python 2.7.6)时,我收到一条错误消息,如
import serial
ser = serial.Serial('/dev/ttyACM0', 9600, serial.EIGHTBITS, serial.PARITY_NONE, serial.STOPBITS_ONE)
ser.write([4, 9, 62, 144, 56, 30, 147, 3, 210, 89, 111, 78, 184, 151, 17, 129])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 475, in write
n = os.write(self.fd, d)
TypeError: must be string …Run Code Online (Sandbox Code Playgroud) 我正在尝试运行一个简单的代码,我在我的Canopy中安装了matplotlib和numpy的所有依赖项.我仍然得到错误.
import cv2
import numpy as np
import matplotlib.pyplot as plt
x = cv2.imread('jay.jpg')
plt.imshow(x, cmap = 'gray', interpolation = 'bicubic')
plt.xticks([]), plt.yticks([]) # to hide tick values on X and Y axis
plt.show()
Run Code Online (Sandbox Code Playgroud)
错误:
%run "c:\users\jay\appdata\local\temp\tmppvibq9.py"
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
c:\users\jay\appdata\local\temp\tmppvibq9.py in <module>()
2 import numpy as np
3 import matplotlib.cbook
----> 4 import matplotlib.pyplot as plt
5
6 x = cv2.imread('jay.jpg')
C:\Users\Jay\AppData\Local\Enthought\Canopy\System\Lib\site-packages\matplotlib\pyplot.py in <module>()
27 from cycler import cycler
28 import matplotlib
---> 29 import …Run Code Online (Sandbox Code Playgroud) 我正在Mac OSX上运行jupyter笔记本(Enthought Canopy python发行版2.7)(v 10.13.6).当我尝试导入pandas(导入pandas为pd)时,我收到了投诉:ImportError:dateutil 2.5.0是所需的最低版本.我有这些包版本:
当我使用Canopy编辑器运行时,我没有得到这个抱怨所以它必须是一些jupyter兼容性问题.有没有人有解决方法如何解决这个问题?几个月前一切都很好,直到我最近(并且无意识地)允许更新我的包裹.
我有一个基本的终端问题.我刚刚在Snow Leopard上安装了enthought的Canopy for Python,当我在命令行上工作时,(Canopy 64bit)不断出现.
EX :( Canopy 64bit)Macbook~ [用户名] $
我试过编辑我的bashrc文件,但无济于事.
bashrc目前有这个:
# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
return
fi
PS1="Macbook~\u\$"
# Make bash check its window size after a process completes
shopt -s checkwinsize
Run Code Online (Sandbox Code Playgroud)
-
有没有办法阻止"(Canopy 64bit)"显示?
随后pip list我显示了已安装模块的列表,其中包括scipy,numpy和pandas.
如果我是其中pip install -U...任何一个,它会检查它,看到它是最新的,然后返回提示.但是,如果我pip uninstall pandas或我在列表中看到的任何项目,它说
Can't uninstall numpy. No files were found to uninstall
我通过Enthought的Canopy Stack安装了与Python有关的所有内容.
我在地球科学应用中广泛使用 Python(Canopy)。因为我的应用程序是内存消耗,我试图找到方法来擦除我的程序中不再需要的变量,我尝试使用 del 命令来擦除变量内存,但我发现 Canopy 使用的空间仍然是相同的。关于如何从内存中完全擦除变量的任何想法。谢谢
canopy ×10
python ×7
enthought ×3
matplotlib ×2
pandas ×2
emacs ×1
histogram ×1
ipython ×1
key-bindings ×1
lua ×1
macos ×1
pip ×1
pyserial ×1
python-2.7 ×1
scikit-learn ×1
spyder ×1
terminal ×1
torch ×1
uninstall ×1