packages

Hide implementation modules and submodules in package

痴心易碎 提交于 2019-12-11 07:44:06
问题 I want to package my code to expose only the main functions. My directory is like this: ./ setup.py my_module/ __init__.py public_functions.py internal_modules/ __init__.py A.py B.py other_modules.py/ __init__.py C.py In public_functions I do import some operations from internal_modules.A but NOT from internal_modules.B , and both A.py and B.py uses some functions from C.py . My setup.py is as follows: from setuptools import setup setup(name='my_module', version='0.1', description='my_awesome

Java package naming and non .com domains

孤者浪人 提交于 2019-12-11 07:07:37
问题 From what I understand Java packages often use a company's website as a package namespace. For example if stackoverflow had a Java widget library it might be called com.stackoverflow.widget. But what happens if you use an obscure TLD. Is info.example.widget acceptable? 回答1: Sure, no problem. Whatever your company's domain name and whatever its TLD is, reverse the order of its components for your Java packages. 回答2: The intent of using a domain name is that it helps ensure uniqueness using

Unable to install package forecast in R

▼魔方 西西 提交于 2019-12-11 07:00:44
问题 I am trying to install package forecast in R using below command install.packages("forecast") , but getting message that trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/forecast_8.2.zip' Content type 'application/zip' length 2076974 bytes (2.0 MB) downloaded 2.0 MB package ‘forecast’ successfully unpacked and MD5 sums checked Warning in install.packages : cannot remove prior installation of package ‘forecast’ I manually removed package from local folder as remove.package was also

Problem in defining a module in omnetpp

主宰稳场 提交于 2019-12-11 06:57:27
问题 Hi I'm writing a project in omnet, but I'm stuck on defining my own module. On https://github.com/lbedogni/Basic-Broadcast-Simulation there is the full code. The problem is that i get the following error message: <!> Error in module (cCompoundModule) scenario.host[0] (id=4) at event \#1, t=0: Class "basic::Flooding" not found -- perhaps its code was not linked in, or the class wasn't registered with Register_Class(), or in the case of modules and channels, with Define_Module()/Define_Channel(

Elegant way to check for missing packages and install them?

这一生的挚爱 提交于 2019-12-11 06:40:59
问题 I seem to be sharing a lot of code with coauthors these days. Many of them are novice/intermediate R users and don't realize that they have to install packages they don't already have. Is there an elegant way to call installed.packages() , compare that to the ones I am loading and install if missing? 回答1: Yes. If you have your list of packages, compare it to the output from installed.packages()[,"Package"] and install the missing packages. Something like this: list.of.packages <- c("ggplot2",

python: list modules within the package

落花浮王杯 提交于 2019-12-11 06:14:24
问题 I have a package with a few modules, each module has a class (or a few classes) defined within it. I need to get the list of all modules within the package. Is there an API for this in python? Here is the file structure: \pkg\ \pkg\__init__.py \pkg\module1.py -> defines Class1 \pkg\module2.py -> defines Class2 \pkg\module3.py -> defines Class3 and Class31 from within module1 I need to get the list of modules within pkg , and then import all the classes defined in these modules Update 1: Ok,

New mark ^ in package.json file

萝らか妹 提交于 2019-12-11 05:52:08
问题 After last npm update, i found that some package versions started with ^ . I can't found any information about it, because of filtering suck signs by search engines. So, it looks like: "grunt-autoprefixer": "^0.4.2", "grunt-bower-install": "^0.7.0", "grunt-concurrent": "^0.4.3", "grunt-contrib-clean": "~0.5.0", Some, are old ~ . I will be grateful for any likes or information about that. I have a suggestion that it indicates witch packages was updated. 回答1: The caret, [...] will update you to

ModuleNotFoundError in Spyder

杀马特。学长 韩版系。学妹 提交于 2019-12-11 05:07:02
问题 I tried to import the biopython package in Spyder. I always get the error message ModuleNotFoundError: No module named 'biopython' although biopython is installed. I also checked the PYTHONPATH: there is a path set into the directory where the packages are stored. Can somebody help? Did I miss something? Thanks for your help! 回答1: If you're using Anaconda, it's best to install all the packages you want from Anaconda if possible. You can check if a package is available with (e.g.): conda

制作本地yum源

妖精的绣舞 提交于 2019-12-11 04:05:21
CentOS-6.7-x86_64-bin-DVD1.iso 完整版的安装盘 CentOS-6.7-x86_64-bin-DVD2.iso 对完整版安装盘的软件进行补充和升级 创建相关目录 /mnt/dvd1和/mnt/dvd2 分别用于挂载 Centos 镜像 /mnt/dvd3 合并后的镜像文件 mkdir -p /mnt/dvd1 /mnt/dvd2 /mnt/dvd3 上传 Centos 镜像到服务器(mnt/iso, 这个路径上一步没有创建, 需要自己创建),挂载 Centos 镜像文件 mount -o loop /mnt/iso/CentOS-6.5-x86_64-bin-DVD1.iso /mnt/dvd1 mount -o loop /mnt/iso/CentOS-6.5-x86_64-bin-DVD2.iso /mnt/dvd2 -o 用来描述设备或档案的挂接方式。 loop:把一个文件当成硬盘分区挂接上系统。 若是想取消挂载 则用 umount 拷贝文件 首先, 拷贝第一张DVD中的所有文件到 /mnt/dvd3 目录下,然后, 只拷贝第二张 DVD 中 Packages 目录下的所有RPM文件到 /mnt/dvd3/Packages 目录下 cp -av /mnt/dvd1/* /mnt/dvd3/ cp -v /mnt/dvd2/Packages/*

Using a project's package in another project in eclipse

老子叫甜甜 提交于 2019-12-11 03:55:19
问题 how can I use the classes of a package out of the main project where it has been defined? for example imagine there is an Employee class in package people which belongs to ProjectOne. let's assume Employee is needed in another project (ProjectTwo) with the same features.What should I do there? 回答1: Right-click on ProjectTwo in the Package Explorer. Go to Build Path -> Configure Build Path. Go to the Projects tab, click Add, select ProjectOne, and click OK, then click OK again to exit the