小编Kyl*_*e J的帖子

Python Scikit-image使用Pip安装失败

我正在尝试安装scikit-image并获取此错误输出消息.我不确定如何正确地显示文本,所以我只做了一个简单的粘贴.

building 'skimage.external.tifffile._tifffile' extension
    compiling C sources
    creating build\temp.win32-2.7\Release\skimage\external
    creating build\temp.win32-2.7\Release\skimage\external\tifffile
    C:\Users\Kyle\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG /arch:SSE2 -Ic:\python27\lib\site-packages\numpy\core\include -Ic:\python27\lib\site-packages\numpy\core\include -Ic:\python27\include -Ic:\python27\PC /Tcskimage\external\tifffile\tifffile.c /Fobuild\temp.win32-2.7\Release\skimage\external\tifffile\tifffile.obj
    tifffile.c
    skimage\external\tifffile\tifffile.c(75) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
    error: Command "C:\Users\Kyle\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG /arch:SSE2 -Ic:\python27\lib\site-packages\numpy\core\include -Ic:\python27\lib\site-packages\numpy\core\include -Ic:\python27\include -Ic:\python27\PC /Tcskimage\external\tifffile\tifffile.c /Fobuild\temp.win32-2.7\Release\skimage\external\tifffile\tifffile.obj" failed with exit status 2
Run Code Online (Sandbox Code Playgroud)

python pip scikit-image

6
推荐指数
1
解决办法
3359
查看次数

从字符串中删除指定的字符

我有兴趣使用String.replaceAll允许我删除String的特定序列的函数.

  1. String.replaceAll替换第一次出现的String序列的功能是否更换?我的假设是肯定的.

  2. 要替换特定的子字符串,我如何替换提供的字符串中的字符?

    String sentence = "@red@@blue@@green@Hello@reset@";
    
    Run Code Online (Sandbox Code Playgroud)

    我想要删除的子字符串是从@另一个@,在这种情况下,在运行时String.replace

    String.replaceAll("@**PATTERN HERE SO NAME WON"T MATTER**@", "");
    
    Run Code Online (Sandbox Code Playgroud)

编辑看到替换和替换所有,因为在两个差异之间,使用正则表达式.我担心的是删除第一次出现的表达式,作为原始字符串

String sentence = "@red@@blue@@green@Hello@reset@";
Run Code Online (Sandbox Code Playgroud)

必须运行4次才能将"Hello"作为String的剩余成员.

示例:运行1 - replaceFirstOccurence("@ regex @","");

System.out.println(sentence); --> "@blue@@green@Hello@reset@"
Run Code Online (Sandbox Code Playgroud)

运行2 - replaceFirstOccurence("@ regex @","");

System.out.println(sentence); --> "@green@Hello@reset@"
Run Code Online (Sandbox Code Playgroud)

运行3 - replaceFirstOccurence("@ regex @","");

System.out.println(sentence); --> "Hello@reset@"
Run Code Online (Sandbox Code Playgroud)

运行4 - replaceFirstOccurence("@ regex @","");

System.out.println(sentence); --> "Hello"
Run Code Online (Sandbox Code Playgroud)

java string

1
推荐指数
1
解决办法
71
查看次数

使用read()和write()进行分段错误(Core Dumped)

我已经退出了C近两年的编程,并且最近在学校使用write()和read()获得了一项任务.

代码中的某个地方我收到了Segmentation Fault错误,可能在filecopy函数上是我付钱的地方.我正在尝试GDB,但我没有使用过,因为上次我用C语言编程所以我转到这里.

代码.

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>

int main(int argc, char *argv[]) {

void filecopy(int infd, int outfd);

int fd = -1;
char *prog = argv[0];
if(argc == 1) 
    filecopy(STDIN_FILENO, STDOUT_FILENO);
else 
    while(--argc > 0) {
        if((fd = open(*++argv, O_RDONLY, "rb")) == -1) {
            // we don't have fprintf... but we have sprintf =]
            char tmp[30];
            sprintf(tmp, "%s: can't open %s\0", prog, *argv);
            write(STDOUT_FILENO, &tmp, sizeof(tmp));    
            exit(-1);
        } else {
            filecopy(fd, STDOUT_FILENO); 
            close(fd); …
Run Code Online (Sandbox Code Playgroud)

c

1
推荐指数
1
解决办法
678
查看次数

标签 统计

c ×1

java ×1

pip ×1

python ×1

scikit-image ×1

string ×1