当我运行代码时,
conda info --envs
它列出了三个环境,但我知道我有更多的环境,因为当我激活其他环境(我记得创建)时,它可以工作。
这是否表明我的conda环境有问题? 有办法解决吗?
我正在运行Windows 10系统。安装了python 3.5
答案 0 :(得分:7)
如果未列出的环境位于某个非标准位置,您始终可以将它们添加到要搜索的目录列表中:
package com.drew.metadata;
import com.drew.imaging.ImageMetadataReader;
import com.drew.imaging.ImageProcessingException;
import com.drew.imaging.jpeg.JpegMetadataReader;
import com.drew.imaging.jpeg.JpegProcessingException;
import com.drew.imaging.jpeg.JpegSegmentMetadataReader;
import com.drew.metadata.exif.ExifReader;
import com.drew.metadata.iptc.IptcReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.util.Arrays;
import java.util.logging.Level;
import java.util.logging.Logger;
public static void main(String[] args)
{
File file = new File("Tests/Data/image.jpg");
try {
Metadata metadata = ImageMetadataReader.readMetadata(file);
print(metadata);
} catch (ImageProcessingException e) {
} catch (IOException e) {
}
try {
Metadata metadata = JpegMetadataReader.readMetadata(file);
print(metadata);
} catch (JpegProcessingException e) {
} catch (IOException e) {
}
try {
Iterable<JpegSegmentMetadataReader> readers = Arrays.asList(new ExifReader(), new IptcReader());
Metadata metadata = JpegMetadataReader.readMetadata(file, readers);
print(metadata);
} catch (JpegProcessingException e) {
} catch (IOException e) {
}
}
private static void print(Metadata metadata) throws FileNotFoundException
{
PrintStream output = new PrintStream(new File("E:/Project/output.txt"));
//System.out.println("-------------------------------------");
for (Directory directory : metadata.getDirectories()) {
for (Tag tag : directory.getTags()) {
output.println(tag);
//System.out.println(tag);
}
if (directory.hasErrors()) {
for (String error : directory.getErrors()) {
System.err.println("ERROR: " + error);
}
}
}
output.close();
}
}